Skip to content

Commit

Permalink
btrfs: only unlock block in verify_parent_transid if we locked it
Browse files Browse the repository at this point in the history
This is a regression from my patch a26e8c9, 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>
  • Loading branch information
Josef Bacik authored and Chris Mason committed Jun 28, 2014
1 parent 46c4e71 commit 472b909
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,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;
}

Expand Down

0 comments on commit 472b909

Please sign in to comment.