]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
fstests: btrfs: add a new test case to verify quick qgroup inherit
authorQu Wenruo <wqu@suse.com>
Thu, 4 Dec 2025 04:41:08 +0000 (15:11 +1030)
committerZorro Lang <zlang@kernel.org>
Wed, 31 Dec 2025 22:33:54 +0000 (06:33 +0800)
commit1da7f10cd89d3392f68cadf7c08f43107c9c0295
tree6e027dae80ecd1380b3e31ef3b0ec4fbecd4a852
parentad2b96dd66ef34798c83aef841930bf90797b874
fstests: btrfs: add a new test case to verify quick qgroup inherit

[BUG]
There is a bug report that simple quota exposed a bug in the quick
qgroup inherit, that if there is a multi-level qgroup parent
relationship, only the direct parent got updated.

[TEST CASE]
The test case will create the following subvolume and qgroups first:

- A new subvolume at '/subv1'
- Qgroup 1/1
- Qgroup 2/1

And subvolume '/subv1' is assgiend to qgroup 1/1, so 1/1 is the direct
parent.
Then qgroup 1/1 is also assigned to 2/1, so 2/1 is an indirect parent of
subvolume '/subv1'.

Then the trigger part is to creating a snapshot of '/subv1' and also
assigned the new snapshot into qgroup 1/1 during the snapshot creation.

Since 1/1 is the parent of '/subv1' and the new snapshot, and qgroup 1/1
fully owns '/subv1', we can do a quick inherit.

After the triggering part, just finish the test case and the fsck after
the test case should detect any qgroup inconsistency.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/340 [new file with mode: 0755]
tests/btrfs/340.out [new file with mode: 0644]