]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: only unlock block in verify_parent_transid if we locked it
authorJosef Bacik <jbacik@fb.com>
Wed, 25 Jun 2014 20:45:41 +0000 (13:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 18:21:31 +0000 (11:21 -0700)
commit 472b909ff6f4884d235ef7b9d3847fad5efafbff upstream.

This is a regression from my patch a26e8c9f75b0bfd8cccc9e8f110737b136eb5994, we
need to only unlock the block if we were the one who locked it.  Otherwise this
will trip BUG_ON()'s in locking.c  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/disk-io.c

index a62a5bdc050277841b75e377ca7f1b259d05c82a..10f3c5c8783d8b7004225cc6d9d12ad6ef31c615 100644 (file)
@@ -368,7 +368,8 @@ static int verify_parent_transid(struct extent_io_tree *io_tree,
 out:
        unlock_extent_cached(io_tree, eb->start, eb->start + eb->len - 1,
                             &cached_state, GFP_NOFS);
-       btrfs_tree_read_unlock_blocking(eb);
+       if (need_lock)
+               btrfs_tree_read_unlock_blocking(eb);
        return ret;
 }