瀏覽代碼

Btrfs: fix btrfs_unlock_up_safe to walk the entire path

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>
Chris Mason 16 年之前
父節點
當前提交
12f4daccfc
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      fs/btrfs/ctree.c

+ 2 - 2
fs/btrfs/ctree.c

@@ -1439,9 +1439,9 @@ noinline void btrfs_unlock_up_safe(struct btrfs_path *path, int level)
 
 
 	for (i = level; i < BTRFS_MAX_LEVEL; i++) {
 	for (i = level; i < BTRFS_MAX_LEVEL; i++) {
 		if (!path->nodes[i])
 		if (!path->nodes[i])
-			break;
+			continue;
 		if (!path->locks[i])
 		if (!path->locks[i])
-			break;
+			continue;
 		btrfs_tree_unlock(path->nodes[i]);
 		btrfs_tree_unlock(path->nodes[i]);
 		path->locks[i] = 0;
 		path->locks[i] = 0;
 	}
 	}