]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: don't map extent buffer if path->skip_locking is set
authorJosef Bacik <josef@redhat.com>
Wed, 8 Jun 2011 18:45:50 +0000 (14:45 -0400)
committerArne Jansen <sensille@gmx.net>
Fri, 10 Jun 2011 10:14:12 +0000 (12:14 +0200)
commitff0dd17d6a25e828744369f2b9695180d72014b1
tree46f2081646866cea4f89d8f20c5f632f14e3bc2a
parent831b26d479b716f1164e827b443dbc2f02f7053e
Btrfs: don't map extent buffer if path->skip_locking is set

Arne's scrub stuff exposed a problem with mapping the extent buffer in
reada_for_search.  He searches the commit root with multiple threads and with
skip_locking set, so we can race and overwrite node->map_token since node isn't
locked.  So fix this so that we only map the extent buffer if we don't already
have a map_token and skip_locking isn't set.  Without this patch scrub would
panic almost immediately, with the patch it doesn't panic anymore.  Thanks,

Reported-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Josef Bacik <josef@redhat.com>
fs/btrfs/ctree.c