]> 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:36:54 +0000 (14:36 -0400)
committerJosef Bacik <josef@redhat.com>
Thu, 9 Jun 2011 14:12:07 +0000 (10:12 -0400)
commit43c8e880ffeb11412f8a3916d19ebb5c7e25eecf
tree3f95ff0f54340bf63885e1d38766cf52a05d3029
parent5ffed3eedeb40d5107d9a727c29077638d760ddd
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