Skip to content

Commit

Permalink
Btrfs: fix btrfs_unlock_up_safe to walk the entire path
Browse files Browse the repository at this point in the history
btrfs_unlock_up_safe would break out at the first NULL node entry or
unlocked node it found in the path.

Some of the callers have missing nodes at the lower levels of the path, so this
commit fixes things to check all the nodes in the path before returning.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Feb 4, 2009
1 parent 4d081c4 commit 12f4dac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,9 +1439,9 @@ noinline void btrfs_unlock_up_safe(struct btrfs_path *path, int level)

for (i = level; i < BTRFS_MAX_LEVEL; i++) {
if (!path->nodes[i])
break;
continue;
if (!path->locks[i])
break;
continue;
btrfs_tree_unlock(path->nodes[i]);
path->locks[i] = 0;
}
Expand Down

0 comments on commit 12f4dac

Please sign in to comment.