]> git.hungrycats.org Git - linux/commitdiff
Btrfs: use btrfs_get_fs_root in resolve_indirect_ref
authorJosef Bacik <jbacik@fb.com>
Thu, 10 Sep 2015 20:02:03 +0000 (16:02 -0400)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Wed, 28 Oct 2015 01:07:17 +0000 (21:07 -0400)
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 <jbacik@fb.com>
(cherry picked from commit 9476e6cfdffdb9d57f22cded973e7a0bf84c7dbe)
(cherry picked from commit 471c5220693a1aa787b76489f8b6948b98733516)

fs/btrfs/backref.c

index 8474ae3cb71eafc3ca232427a2288f734b9d1d61..741bdb994e52aa492652eeecf9658a4e2d5637b1 100644 (file)
@@ -355,7 +355,7 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info,
 
        index = srcu_read_lock(&fs_info->subvol_srcu);
 
-       root = btrfs_read_fs_root_no_name(fs_info, &root_key);
+       root = btrfs_get_fs_root(fs_info, &root_key, false);
        if (IS_ERR(root)) {
                srcu_read_unlock(&fs_info->subvol_srcu, index);
                ret = PTR_ERR(root);