aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2014-06-25 16:45:41 -0400
committerChris Mason <clm@fb.com>2014-06-28 16:48:47 -0400
commit472b909ff6f4884d235ef7b9d3847fad5efafbff (patch)
treeeee3ce7df92823bedb0f0d922221e380304d7e2d /fs/btrfs
parent46c4e71e9b02a649c722f06569f5b6575da02dba (diff)
btrfs: only unlock block in verify_parent_transid if we locked it
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, cc: stable@vger.kernel.org Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/disk-io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 8bb4aa19898f..f00165de6fbf 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -369,7 +369,8 @@ static int verify_parent_transid(struct extent_io_tree *io_tree,
369out: 369out:
370 unlock_extent_cached(io_tree, eb->start, eb->start + eb->len - 1, 370 unlock_extent_cached(io_tree, eb->start, eb->start + eb->len - 1,
371 &cached_state, GFP_NOFS); 371 &cached_state, GFP_NOFS);
372 btrfs_tree_read_unlock_blocking(eb); 372 if (need_lock)
373 btrfs_tree_read_unlock_blocking(eb);
373 return ret; 374 return ret;
374} 375}
375 376