• Josef Bacik's avatar
    Btrfs: don't map extent buffer if path->skip_locking is set · 25b8b936
    Josef Bacik authored
    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: default avatarArne Jansen <sensille@gmx.net>
    Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
    25b8b936
ctree.c 112 KB