Skip to content

Commit 2d9e977

Browse files
Josef Bacikmasoncl
authored andcommitted
Btrfs: use btrfs_get_fs_root in resolve_indirect_ref
The backref code will look up the fs_root we're trying to resolve our indirect refs for, unfortunately we use btrfs_read_fs_root_no_name, which returns -ENOENT if the ref is 0. This isn't helpful for the qgroup stuff with snapshot delete as it won't be able to search down the snapshot we are deleting, which will cause us to miss roots. So use btrfs_get_fs_root and send false for check_ref so we can always get the root we're looking for. Thanks, Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Mark Fasheh <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent 967ef51 commit 2d9e977

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/backref.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info,
355355

356356
index = srcu_read_lock(&fs_info->subvol_srcu);
357357

358-
root = btrfs_read_fs_root_no_name(fs_info, &root_key);
358+
root = btrfs_get_fs_root(fs_info, &root_key, false);
359359
if (IS_ERR(root)) {
360360
srcu_read_unlock(&fs_info->subvol_srcu, index);
361361
ret = PTR_ERR(root);

0 commit comments

Comments
 (0)