* [PATCH] Btrfs: fix qgroup sanity tests
@ 2015-10-05 15:03 Josef Bacik
2015-10-07 8:45 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Josef Bacik @ 2015-10-05 15:03 UTC (permalink / raw)
To: linux-btrfs, kernel-team
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>
---
fs/btrfs/backref.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 5de66e9..905d697 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -339,6 +339,13 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info,
goto out;
}
+#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
+ if (unlikely(test_bit(BTRFS_ROOT_DUMMY_ROOT, &root->state))) {
+ srcu_read_unlock(&fs_info->subvol_srcu, index);
+ ret = -ENOENT;
+ goto out;
+ }
+#endif
if (path->search_commit_root)
root_level = btrfs_header_level(root->commit_root);
else if (time_seq == (u64)-1)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Btrfs: fix qgroup sanity tests
2015-10-05 15:03 [PATCH] Btrfs: fix qgroup sanity tests Josef Bacik
@ 2015-10-07 8:45 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2015-10-07 8:45 UTC (permalink / raw)
To: Josef Bacik; +Cc: linux-btrfs, kernel-team
On Mon, Oct 05, 2015 at 11:03:08AM -0400, Josef Bacik wrote:
> +#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
> + if (unlikely(test_bit(BTRFS_ROOT_DUMMY_ROOT, &root->state))) {
> + srcu_read_unlock(&fs_info->subvol_srcu, index);
> + ret = -ENOENT;
> + goto out;
> + }
> +#endif
The inline ifdefs are not necessary, please use the helper
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -362,13 +362,12 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info,
goto out;
}
-#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
- if (unlikely(test_bit(BTRFS_ROOT_DUMMY_ROOT, &root->state))) {
+ if (btrfs_test_is_dummy_root(root)) {
srcu_read_unlock(&fs_info->subvol_srcu, index);
ret = -ENOENT;
goto out;
}
-#endif
+
if (path->search_commit_root)
root_level = btrfs_header_level(root->commit_root);
else if (time_seq == (u64)-1)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-07 8:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05 15:03 [PATCH] Btrfs: fix qgroup sanity tests Josef Bacik
2015-10-07 8:45 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).