Commit 472b909f authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason

btrfs: only unlock block in verify_parent_transid if we locked it

This is a regression from my patch a26e8c9f, 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: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 46c4e71e
...@@ -369,6 +369,7 @@ static int verify_parent_transid(struct extent_io_tree *io_tree, ...@@ -369,6 +369,7 @@ static int verify_parent_transid(struct extent_io_tree *io_tree,
out: out:
unlock_extent_cached(io_tree, eb->start, eb->start + eb->len - 1, unlock_extent_cached(io_tree, eb->start, eb->start + eb->len - 1,
&cached_state, GFP_NOFS); &cached_state, GFP_NOFS);
if (need_lock)
btrfs_tree_read_unlock_blocking(eb); btrfs_tree_read_unlock_blocking(eb);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment