]> git.hungrycats.org Git - linux/commitdiff
Btrfs: fix qgroup sanity tests
authorJosef Bacik <jbacik@fb.com>
Mon, 5 Oct 2015 14:35:29 +0000 (10:35 -0400)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Thu, 22 Oct 2015 01:08:15 +0000 (21:08 -0400)
With my changes to allow us to find old roots when resolving indirect refs I
introduced a regression to the sanity tests.  Since we don't really care to go
down into the fs roots we just need to have the old behavior of returning ENOENT
for dummy roots for the sanity tests.  In the future if we want to get fancy we
can populate the test fs trees with the references as well.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
(cherry picked from commit 5d4dcafe25494e631f8a4477f6c6470e7e8aee9e)

fs/btrfs/backref.c

index b3c7b2ebe26e914328383ea1853727b395212a0e..1646416fa4801d9a421c0db8ec8eee2377bbd627 100644 (file)
@@ -355,6 +355,12 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info,
                goto out;
        }
 
+       if (btrfs_test_is_dummy_root(root)) {
+               srcu_read_unlock(&fs_info->subvol_srcu, index);
+               ret = -ENOENT;
+               goto out;
+       }
+
        if (path->search_commit_root)
                root_level = btrfs_header_level(root->commit_root);
        else