diff options
author | Josef Bacik <jbacik@fb.com> | 2014-06-25 13:45:41 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-09 11:21:31 -0700 |
commit | 058ac415b7f9def73cd6badf5c2f84b16afe6e85 (patch) | |
tree | 98f44674feaf72f6406121dceed8ed87237d0ada | |
parent | 9b7954efb6d58c67a0504427a92f532412adc0fd (diff) |
btrfs: only unlock block in verify_parent_transid if we locked it
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>
-rw-r--r-- | fs/btrfs/disk-io.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index a62a5bdc050..10f3c5c8783 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -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; } |