]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
btrfs: add a test case to verify that per-fs features directory gets updated
authorQu Wenruo <wqu@suse.com>
Fri, 13 Jan 2023 07:06:53 +0000 (15:06 +0800)
committerZorro Lang <zlang@kernel.org>
Sun, 23 Jul 2023 04:56:47 +0000 (12:56 +0800)
commit8de535c53887bb49adae74a1b2e83e77d7e8457d
tree3d2142be8082e59cb174d9f3deeccd8b73fd2d6e
parent9b84d93f225f4ffbb61030ac39ef89ee459e64b1
btrfs: add a test case to verify that per-fs features directory gets updated

Although btrfs has a per-fs feature directory, it's not properly
refreshed after new features are enabled.

We had some attempts to do that properly, like commit 14e46e04958d
("btrfs: synchronize incompat feature bits with sysfs files").
But unfortunately that commit get later reverted as some call sites is
not safe to update sysfs files.

Now we have a new commit b7625f461da6 ("btrfs: sysfs: update fs features
directory asynchronously") to properly refresh that per-fs features
directory.

So it's time to add a test case for it. The test case itself is pretty
straightforward:

- Make a very basic 3 disks btrfs
  Only using the very basic profiles (DUP/SINGLE) so that even older
  mkfs.btrfs can support.

- Make sure per-fs features directory doesn't contain "raid1c34" file

- Balance the metadata to RAID1C3 profile

- Verify the per-fs features directory contains "raid1c34" feature file

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
[ Update commit log. Remove commented code. Add _fixed_by_kernel_commit.
  Check mkfs status. Add sync. ]
Signed-off-by: Anand Jain <anand.jain@oracle.com>
tests/btrfs/296 [new file with mode: 0755]
tests/btrfs/296.out [new file with mode: 0644]