]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/log
xfstests-dev.git
7 weeks agogeneric/767: allow on any atomic writes filesystem
Darrick J. Wong [Tue, 29 Jul 2025 20:09:32 +0000 (13:09 -0700)]
generic/767: allow on any atomic writes filesystem

This test now works correctly for any atomic writes geometry since we
control all the parameters.  Remove this restriction so that we can get
minimal testing on ext4 and fuse2fs.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
7 weeks agogeneric/767: only test the hardware atomic write unit
Darrick J. Wong [Tue, 29 Jul 2025 20:09:17 +0000 (13:09 -0700)]
generic/767: only test the hardware atomic write unit

This test sets up scsi_debug so that we can test the fs and block layer
code for hardware-accelerated atomic writes (and not just a software
fallback).  However, the userspace ABI for detecting atomic write
geometry has changed since the start of development (to include said
software fallback) so we must add some extra code to find the real
hardware capabilities, and base the write sizes based on that.

This fixes a test failure with 32k blocksizes because the advertised
atomic_write_unit_max is 128M and fallocate quickly runs out of space.

While we're at it fix a stupid variable usage bug in the loop.

Cc: fstests@vger.kernel.org # v2025.07.13
Fixes: fa8694c823d853 ("generic: various atomic write tests with hardware and scsi_debug")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
7 weeks agogeneric/767: require fallocate support
Darrick J. Wong [Tue, 29 Jul 2025 20:09:01 +0000 (13:09 -0700)]
generic/767: require fallocate support

This test fails on filesystems that don't support fallocate, so screen
them out.

Cc: fstests@vger.kernel.org # v2025.07.13
Fixes: fa8694c823d853 ("generic: various atomic write tests with hardware and scsi_debug")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
7 weeks agoxfs/432: fix metadump loop device blocksize problems
Darrick J. Wong [Tue, 29 Jul 2025 20:10:35 +0000 (13:10 -0700)]
xfs/432: fix metadump loop device blocksize problems

Make sure the lba size of the loop devices created for the metadump
tests actually match that of the real SCRATCH_ devices or else the tests
will fail.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
7 weeks agoxfs/259: try to force loop device block size
Darrick J. Wong [Tue, 29 Jul 2025 20:10:19 +0000 (13:10 -0700)]
xfs/259: try to force loop device block size

Starting with 6.15-rc1, loop devices created with directio mode enabled
will set their logical block size to whatever STATX_DIO_ALIGN on the
host filesystem reports.  If you want fstests to set up loop devices in
directio mode and TEST_DEV is a block device with 4k sectors, this will
cause conflicts with this test's usage of mkfs with different block
sizes.  Enhance the existing _create_loop_device so that tests can force
the loop device block size to 512 bytes, which is implied by scenarios
such as "device size is 4T - 2048 bytes".

Also fix xfs/078 which simply needs the blocksize to be set.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
7 weeks agogeneric: test fsync of file with 0 links and extents
Filipe Manana [Wed, 30 Jul 2025 19:21:41 +0000 (20:21 +0100)]
generic: test fsync of file with 0 links and extents

Create two files, the first one with some data, and then fsync both
files. The first file is fsynced after removing its hardlink. After a
power failure we expect the fs to be mountable and for only the second
file to be present.

This exercises an issue found in btrfs and fixed by the following patch:

  btrfs: fix log tree replay failure due to file with 0 links and extents

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
7 weeks agoxfs/189: fix remount barrier test failure
Anthony Iliopoulos [Wed, 30 Jul 2025 17:28:26 +0000 (19:28 +0200)]
xfs/189: fix remount barrier test failure

_test_remount_barrier() is skipped on kernels newer than v4.19 where the
barrier options have been removed, and this is detected by matching the
mount command output for a "bad option" error.

Recent util-linux commit 9da5644e414c ("libmount: report kernel message
from new API"), which was introduced in v2.41 release changed that error
message from the old hardcoded one:

  mount: /mnt/scratch: mount point not mounted or bad option.

to the newer, and more specific coming from the kernel:

  mount: /mnt/scratch: fsconfig() failed: xfs: Unknown parameter 'barrier'.

Update the test to account for that change so that the unsupported
options can be properly detected again and for this part of the test to
be skipped successfully.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
7 weeks agobtrfs/301: enhance nested simple quotas test
Boris Burkov [Wed, 30 Jul 2025 23:03:07 +0000 (16:03 -0700)]
btrfs/301: enhance nested simple quotas test

We had a bug with qgroup accounting with 2+ layers, which was most
easily detected with a slightly more complex nested squota hierarchy.
Make the nested squota test case a tiny bit more complex to capture this
test as well.

The kernel patch that this change exercises is:
        btrfs: fix iteration bug in __qgroup_excl_accounting()

Signed-off-by: Boris Burkov <boris@bur.io>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
8 weeks agogeneric/211: verify if the filesystem being tested supports in place writes
Filipe Manana [Thu, 24 Jul 2025 12:05:59 +0000 (13:05 +0100)]
generic/211: verify if the filesystem being tested supports in place writes

The test currently assumes the filesystem can do in place writes (no
Copy-On-Write, no allocation of new extents) when overwriting a file.
While that is the case for most filesystems in most configurations, there
are exceptions such as zoned xfs where overwriting results in allocating
new extents for the new data.

So make the test check that in place writes are supported and skip the
test if they are not supported.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
8 weeks agoext4/028: require that the scratch file system has the extent feature enabled
Theodore Ts'o [Sun, 20 Jul 2025 03:59:44 +0000 (23:59 -0400)]
ext4/028: require that the scratch file system has the extent feature enabled

If the file system configuration has journalling enabled, but doesn't
have the extent feature enabled (e.g., when testing the ext3
configuration) the test will fail since _scratch_populate_cached
creates files with extents enabled.  So add a check to skip the test
in that case.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agogeneric/365: Add fix hint for ext4 v2025.07.13
Ojaswin Mujoo [Fri, 11 Jul 2025 18:27:44 +0000 (23:57 +0530)]
generic/365: Add fix hint for ext4

This test fails on ext4 if the commit 4a622e4d477b
is missing in the kernel. Add this hint.

Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agobtrfs/282: use timed writes to make sure scrub has enough run time
Qu Wenruo [Fri, 11 Jul 2025 08:43:05 +0000 (18:13 +0930)]
btrfs/282: use timed writes to make sure scrub has enough run time

[FAILURE]
Test case btrfs/282 still fails on some setup:

    output mismatch (see /opt/xfstests/results//btrfs/282.out.bad)
    --- tests/btrfs/282.out 2025-06-27 22:00:35.000000000 +0200
    +++ /opt/xfstests/results//btrfs/282.out.bad 2025-07-08 20:40:50.042410321 +0200
    @@ -1,3 +1,4 @@
     QA output created by 282
     wrote 2147483648/2147483648 bytes at offset 0
     XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
    +scrub speed 2152038400 Bytes/s is not properly throttled, target is 1076019200 Bytes/s
    ...
    (Run diff -u /opt/xfstests/tests/btrfs/282.out /opt/xfstests/results//btrfs/282.out.bad  to see the entire diff)

[CAUSE]
Checking the full output, it shows the scrub is running too fast:

Starting scrub on devid 1
scrub done for c45c8821-4e55-4d29-8172-f1bf30b7182c
Scrub started:    Tue Jul  8 20:40:47 2025
Status:           finished
Duration:         0:00:00 <<<
Total to scrub:   2.00GiB
Rate:             2.00GiB/s
Error summary:    no errors found
Starting scrub on devid 1
scrub done for c45c8821-4e55-4d29-8172-f1bf30b7182c
Scrub started:    Tue Jul  8 20:40:48 2025
Status:           finished
Duration:         0:00:01
Total to scrub:   2.00GiB
Rate:             2.00GiB/s
Error summary:    no errors found

The original run takes less than 1 seconds, making the scrub rate
calculation very unreliable, no wonder the speed limit is not able to
properly work.

[FIX]
Instead of using fixed 2GiB file size, let the test create a filler for
4 seconds with direct IO, this would more or less ensure the scrub will
take 4 seconds to run.

With 4 seconds as run time, the scrub rate can be calculated more or
less reliably.

Furthermore since btrfs-progs currently only reports scrub duration in
seconds, to prevent problems due to 1 second difference, enlarge the
tolerance to +/- 25%, to be extra safe.

On my testing VM, the result looks like this:

Starting scrub on devid 1
scrub done for b542bdfb-7be4-44b3-add0-ad3621927e2b
Scrub started:    Fri Jul 11 09:13:31 2025
Status:           finished
Duration:         0:00:04
Total to scrub:   2.72GiB
Rate:             696.62MiB/s
Error summary:    no errors found
Starting scrub on devid 1
scrub done for b542bdfb-7be4-44b3-add0-ad3621927e2b
Scrub started:    Fri Jul 11 09:13:35 2025
Status:           finished
Duration:         0:00:08
Total to scrub:   2.72GiB
Rate:             348.31MiB/s
Error summary:    no errors found

However this exposed a new failure mode, that if the storage is too
fast, like the original report, that the initial 4 seconds write can
fill the fs and exit early.

In that case we have no other solution but skipping the test case.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agogeneric: test overwriting file with mmap on a full filesystem
Filipe Manana [Thu, 10 Jul 2025 17:03:43 +0000 (18:03 +0100)]
generic: test overwriting file with mmap on a full filesystem

Test that overwriting a file with mmap when the filesystem has no more
space available for data allocation works. The motivation here is to check
that NOCOW mode of a COW filesystem (such as btrfs) works as expected.

This currently fails with btrfs but it's fixed by a kernel patch that has
the subject:

   btrfs: fix -ENOSPC mmap write failure on NOCOW files/extents

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agogeneric/050: add a workaround for btrfs
Qu Wenruo [Wed, 2 Jul 2025 04:53:12 +0000 (14:23 +0930)]
generic/050: add a workaround for btrfs

[BUG]
With the incoming btrfs shutdown ioctl/remove_bdev callback support,
btrfs can be tested with the shutdown group.

But test case generic/050 still fails on btrfs with shutdown support:

generic/050 1s ... - output mismatch (see /home/adam/xfstests/results//generic/050.out.bad)
    --- tests/generic/050.out 2022-05-11 11:25:30.763333331 +0930
    +++ /home/adam/xfstests/results//generic/050.out.bad 2025-06-30 10:22:21.752068622 +0930
    @@ -13,9 +13,7 @@
     setting device read-only
     mounting filesystem that needs recovery on a read-only device:
     mount: device write-protected, mounting read-only
    -mount: cannot mount device read-only
     unmounting read-only filesystem
    -umount: SCRATCH_DEV: not mounted
     mounting filesystem with -o norecovery on a read-only device:
    ...
    (Run 'diff -u /home/adam/xfstests/tests/generic/050.out /home/adam/xfstests/results//generic/050.out.bad'  to see the entire diff)
Ran: generic/050

[CAUSE]
The test case generic/050 has several different golden output depending
on the fs features.

For fses which requires data write (e.g. replay the journal) during
mount, mounting a read-only block device should fail.
And that is the default golden output.

However for btrfs, although it has something similar to a journal, aka
log tree, it's not the traditional journal which is used to protect
metadata update.

The log tree of btrfs is mostly for speeding up fsync() without syncing
the full fs.

This means several things are different with btrfs:

- Regular metadata update won't cause dirty log tree
  The workload here is just touching several files, which will not cause
  the creation of btrfs log tree.

  And the metadata consistency is protected by metadata COW, not
  journal.

- FLUSHLOG shutdown flag will cause btrfs to commit the current
  transaction
  And above new files are recorded in the current transaction, meaning
  those new files will be fully written by a FLUSHLOG shutdown.

This means, unlike fses using traditional journals, touching files then
shutdown with FLUSHLOG will not cause any dirty log tree.

This makes btrfs acts like it doesn't support metadata journaling, at
least for this particular test case.

[FIX]
Since the workload here will not cause btrfs to generate a log tree,
meaning after the shutdown, the fs can still be mounted RO even the
block device is read-only.

So here we have to make an exception for btrfs, that it has to go
through the "nojournal" feature.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agocommon/rc: _add_dmesg_filter returns when RESULT_DIR is null
Zorro Lang [Sun, 22 Jun 2025 20:39:47 +0000 (04:39 +0800)]
common/rc: _add_dmesg_filter returns when RESULT_DIR is null

I always hit below error on a system with readonly rootfs:

  ++ _xfs_prepare_for_eio_shutdown /dev/loop0
  ...
  ++ _add_dmesg_filter 'Internal error'
  ++ local 'regexp=Internal error'
  ++ local filter_file=/dmesg_filter
  ++ '[' '!' -e /dmesg_filter ']'
  ++ echo 'Internal error'
  ./common/rc: line 4716: /dmesg_filter: Read-only file system

The RESULT_DIR is null, due to xfstests/check calls _test_mount and
_scratch_mount before RESULT_DIR creation. And _test_mount does
_prepare_for_eio_shutdown -> _xfs_prepare_for_eio_shutdown ->
_add_dmesg_filter "Internal error" when RESULT_DIR is null.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agocommon/rc: remove useless _pgrep funcion
Zorro Lang [Sun, 22 Jun 2025 20:39:46 +0000 (04:39 +0800)]
common/rc: remove useless _pgrep funcion

The _pgrep() function isn't used anymore, remove it.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agoxfs/259: drop the 512-byte fsblock logic from this test
Darrick J. Wong [Wed, 21 May 2025 22:41:20 +0000 (15:41 -0700)]
xfs/259: drop the 512-byte fsblock logic from this test

V5 filesystems do not support 512-byte fsblocks, and mkfs.xfs has long
defaulted to V5 filesystems.  Drop the 512 from the test loops, which
means we can get rid of all the _fs_has_crcs logic.  As a further
cleanup, use the truncate -s command to create the sparse file instead
of dd since even RHEL7 supports the -s switch.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agoxfs/273: fix test for internal zoned filesystems
Darrick J. Wong [Wed, 21 May 2025 22:41:04 +0000 (15:41 -0700)]
xfs/273: fix test for internal zoned filesystems

For XFS filesystems with internal zoned sections, fsmap reports a u32
cookie for the device instead of an actual major/minor.  Adjust the test
accordingly.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agofstests: check: fix unset seqres in run_section()
Anand Jain [Sat, 24 May 2025 03:57:14 +0000 (11:57 +0800)]
fstests: check: fix unset seqres in run_section()

While testing, I saw that ".full" is created by _scratch_unmount(), called here:

 725 function run_section()
 ::
 815         if [ ! -z "$SCRATCH_DEV" ]; then
 816           _scratch_unmount 2> /dev/null
 817           # call the overridden mkfs - make sure the FS is built

Ensure seqres is set early in run_section() as a fix.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agofstests: remove duplicate initialization in the testcase
Anand Jain [Sat, 24 May 2025 03:57:13 +0000 (11:57 +0800)]
fstests: remove duplicate initialization in the testcase

_begin_fstest() already initializes several variables, including `seq` and
`seqres`, so remove those redundant initializations from the testcase.

Also, ext4/053 unnecessarily re-initializes `here`, `tmp`, and `status`,
which `_begin_fstest` already handles. Remove those as well.

and remove template comment.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agoxfs: more multi-block atomic writes tests
Darrick J. Wong [Thu, 26 Jun 2025 00:27:35 +0000 (17:27 -0700)]
xfs: more multi-block atomic writes tests

Add xfs specific tests for realtime volumes and error recovery.

The first test validates multi-block atomic writes on a realtime file. We
perform basic atomic writes operations within the advertised sizes and ensure
that atomic writes will fail outside of these bounds. The hardware used in this
test is not required to support atomic writes.

The second test verifies that a large atomic write can complete after a crash.
The error is injected while attempting to free an extent. We ensure that this
error occurs by first creating a heavily fragmented filesystem. After recovery,
we check that the write completes successfully.

The third test verifies that a large atomic write on a reflinked file can
complete after a crash. We start with two files that share the same data and
inject an error while attempting to perform a write on one of the files. After
recovery, we verify that these files now contain different data, indicating
that the write has succeeded.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agogeneric: various atomic write tests with hardware and scsi_debug
Darrick J. Wong [Thu, 26 Jun 2025 00:27:34 +0000 (17:27 -0700)]
generic: various atomic write tests with hardware and scsi_debug

Simple tests of various atomic write requests and a (simulated) hardware
device.

The first test performs basic multi-block atomic writes on a scsi_debug device
with atomic writes enabled. We test all advertised sizes between the atomic
write unit min and max. We also ensure that the write fails when expected, such
as when attempting buffered io or unaligned directio.

The second test is similar to the one above, except that it verifies multi-block
atomic writes on actual hardware instead of simulated hardware. The device used
in this test is not required to support atomic writes.

The final two tests ensure multi-block atomic writes can be performed on various
interweaved mappings, including written, mapped, hole, and unwritten. We also
test large atomic writes on a heavily fragmented filesystem. These tests are
separated into reflink (shared) and non-reflink tests.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agocommon/atomicwrites: add helper for multi block atomic writes
Catherine Hoang [Thu, 26 Jun 2025 00:27:33 +0000 (17:27 -0700)]
common/atomicwrites: add helper for multi block atomic writes

Add a helper to check that we can perform multi block atomic writes. We will
use this in the following patches that add testing for large atomic writes.
This helper will prevent these tests from running on kernels that only support
single block atomic writes.

Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agocommon/rc: add btrfs support for _small_fs_size_mb()
Qu Wenruo [Wed, 25 Jun 2025 23:20:21 +0000 (08:50 +0930)]
common/rc: add btrfs support for _small_fs_size_mb()

[FAILURE]
With the incoming shutdown ioctl and remove_bdev callback support, btrfs
is able to run the shutdown group.

However test case like generic/042 fails on btrfs:

generic/042 9s ... [failed, exit status 1]- output mismatch (see /home/adam/xfstests/results//generic/042.out.bad)
    --- tests/generic/042.out 2022-05-11 11:25:30.763333331 +0930
    +++ /home/adam/xfstests/results//generic/042.out.bad 2025-06-26 08:43:56.078509452 +0930
    @@ -1,10 +1 @@
     QA output created by 042
    -falloc -k
    -wrote 65536/65536 bytes at offset 0
    -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
    -fpunch
    -wrote 65536/65536 bytes at offset 0
    -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
    ...
    (Run 'diff -u /home/adam/xfstests/tests/generic/042.out /home/adam/xfstests/results//generic/042.out.bad'  to see the entire diff)
Ran: generic/042
Failures: generic/042
Failed 1 of 1 tests

[CAUSE]
The full output shows the reason directly:

  ERROR: '/mnt/scratch/042.img' is too small to make a usable filesystem
  ERROR: minimum size for each btrfs device is 114294784

And the helper _small_fs_size_mb() doesn't support btrfs, thus the small
25M file is not large enough to support a btrfs.

[FIX]
Fix the false alert by adding btrfs support in _small_fs_size_mb().

The btrfs minimal size is depending on the profiles even on a single
device, e.g. DUP data will cost extra space.

So here we go safe by using 512MiB as the minimal size for btrfs.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 months agocommon/rc: add repair fsck flag -f for ext4
Leah Rumancik [Wed, 25 Jun 2025 21:20:22 +0000 (14:20 -0700)]
common/rc: add repair fsck flag -f for ext4

There is a descrepancy between the fsck flags for ext4 during
filesystem repair and filesystem checking which causes occasional test
failures. In particular, _check_generic_filesystems uses -f for force
checking, but _repair_scratch_fs does not. In some tests, such as
generic/441, we sometimes exit fsck repair early with the filesystem
being deemed "clean" but then _check_generic_filesystems finds issues
during the forced full check. Bringing these flags in sync fixes the
flakes.

Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agooverlay: add tests for data-only redirect with userxattr v2025.06.22
Miklos Szeredi [Mon, 9 Jun 2025 15:19:15 +0000 (17:19 +0200)]
overlay: add tests for data-only redirect with userxattr

New kernel feature (target release is v6.16) allows data-only redirect to
be enabled without metacopy and redirect_dir turned on.  This works with or
without verity enabled.

Tests are done with the userxattr option, to verify that it will work in a
user namespace.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agofstests: add helper _require_xfs_io_shutdown
Amir Goldstein [Mon, 9 Jun 2025 15:19:14 +0000 (17:19 +0200)]
fstests: add helper _require_xfs_io_shutdown

Requirements for tests that shutdown fs using "xfs_io -c shutdown".
The requirements are stricter than the requirement for tests that
shutdown fs using _scratch_shutdown helper.

Generally, with overlay fs, tests can do _scratch_shutdown, but not
xfs_io -c shutdown.

Encode this stricter requirement in helper _require_xfs_io_shutdown
and use it in test generic/623, to express that it cannot run on
overalyfs.

Reported-by: André Almeida <andrealmeid@igalia.com>
Link: https://lore.kernel.org/linux-fsdevel/20250521-ovl_ro-v1-1-2350b1493d94@igalia.com/
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Tested-by: André Almeida <andrealmeid@igalia.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agofstests: add helper _scratch_shutdown_and_syncfs
Amir Goldstein [Mon, 9 Jun 2025 15:19:13 +0000 (17:19 +0200)]
fstests: add helper _scratch_shutdown_and_syncfs

Test xfs/546 has to chain syncfs after shutdown and cannot
use the _scratch_shutdown helper, because after shutdown a fd
cannot be opened to execute syncfs on.

The xfs_io command of chaining syncfs after shutdown is rather
more complex to execute in the derived overlayfs test overlay/087.

Add a helper to abstract this complexity from test writers.
Add a _require statement to match.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agoxfs/820: skip test when metadir is not supported
Anthony Iliopoulos [Thu, 19 Jun 2025 13:30:31 +0000 (15:30 +0200)]
xfs/820: skip test when metadir is not supported

The test specifically requires metadata directory functionality, so make
it dependent on that as otherwise it fails on kernels older than v6.13
that do not implement the feature.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/551: prevent OOM when running on tmpfs with low memory
Daniel Gomez [Wed, 18 Jun 2025 13:00:12 +0000 (15:00 +0200)]
generic/551: prevent OOM when running on tmpfs with low memory

Running generic/551 on a tmpfs filesystem with less than 10 GB (ish)
of RAM can lead to the system running out of memory, triggering the
kernel's OOM killer and terminating the aio-dio-write-v process.

Fix generic/551 by substracting the amount of available memory allocated
for the tmpfs scratch device to the total available free memory.

Reported-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agobtrfs/300: set umask to avoid failure on systems with a different umask
Filipe Manana [Fri, 13 Jun 2025 13:05:08 +0000 (14:05 +0100)]
btrfs/300: set umask to avoid failure on systems with a different umask

The test is assuming a umask of 0022, which is the default on many Linux
setups, but often we can find other umasks such as in recent Debian box
I have where the default umask is 0002, and this makes the test fail like
this:

  $ ./check btrfs/300
  FSTYP         -- btrfs
  PLATFORM      -- Linux/x86_64 debian7 6.16.0-rc1-btrfs-next-200+ #1 SMP PREEMPT_DYNAMIC Thu Jun 12 16:07:55 WEST 2025
  MKFS_OPTIONS  -- /dev/sdb
  MOUNT_OPTIONS -- /dev/sdb /scratch

  btrfs/300 2s ... - output mismatch (see /xfstests/results//btrfs/300.out.bad)
    --- tests/btrfs/300.out 2024-05-20 11:27:55.949395116 +0100
    +++ /xfstests/results//btrfs/300.out.bad 2025-06-12 22:58:20.449228230 +0100
    @@ -2,16 +2,16 @@
     Create subvolume './subvol'
     Create subvolume 'subvol/subsubvol'
     drwxr-xr-x fsgqa fsgqa ./
    -drwxr-xr-x fsgqa fsgqa ./subvol
    --rw-r--r-- fsgqa fsgqa ./subvol/1
    --rw-r--r-- fsgqa fsgqa ./subvol/2
    --rw-r--r-- fsgqa fsgqa ./subvol/3
    ...
    (Run 'diff -u /xfstests/tests/btrfs/300.out /xfstests/results//btrfs/300.out.bad'  to see the entire diff)

  HINT: You _MAY_ be missing kernel fix:
        94628ad94408 btrfs: copy dir permission and time when creating a stub subvolume

  Ran: btrfs/300
  Failures: btrfs/300
  Failed 1 of 1 tests

  $ diff -u /xfstests/tests/btrfs/300.out /xfstests/results//btrfs/300.out.bad
  --- /xfstests/tests/btrfs/300.out 2024-05-20 11:27:55.949395116 +0100
  +++ /xfstests/results//btrfs/300.out.bad 2025-06-12 22:58:20.449228230 +0100
  @@ -2,16 +2,16 @@
   Create subvolume './subvol'
   Create subvolume 'subvol/subsubvol'
   drwxr-xr-x fsgqa fsgqa ./
  -drwxr-xr-x fsgqa fsgqa ./subvol
  --rw-r--r-- fsgqa fsgqa ./subvol/1
  --rw-r--r-- fsgqa fsgqa ./subvol/2
  --rw-r--r-- fsgqa fsgqa ./subvol/3
  -drwxr-xr-x fsgqa fsgqa ./subvol/subsubvol
  --rw-r--r-- fsgqa fsgqa ./subvol/subsubvol/4
  --rw-r--r-- fsgqa fsgqa ./subvol/subsubvol/5
  --rw-r--r-- fsgqa fsgqa ./subvol/subsubvol/6
  -drwxr-xr-x fsgqa fsgqa ./snapshot
  --rw-r--r-- fsgqa fsgqa ./snapshot/1
  --rw-r--r-- fsgqa fsgqa ./snapshot/2
  --rw-r--r-- fsgqa fsgqa ./snapshot/3
  +drwxrwxr-x fsgqa fsgqa ./subvol
  +-rw-rw-r-- fsgqa fsgqa ./subvol/1
  +-rw-rw-r-- fsgqa fsgqa ./subvol/2
  +-rw-rw-r-- fsgqa fsgqa ./subvol/3
  +drwxrwxr-x fsgqa fsgqa ./subvol/subsubvol
  +-rw-rw-r-- fsgqa fsgqa ./subvol/subsubvol/4
  +-rw-rw-r-- fsgqa fsgqa ./subvol/subsubvol/5
  +-rw-rw-r-- fsgqa fsgqa ./subvol/subsubvol/6
  +drwxrwxr-x fsgqa fsgqa ./snapshot
  +-rw-rw-r-- fsgqa fsgqa ./snapshot/1
  +-rw-rw-r-- fsgqa fsgqa ./snapshot/2
  +-rw-rw-r-- fsgqa fsgqa ./snapshot/3
   drwxr-xr-x fsgqa fsgqa ./snapshot/subsubvol

The mismatch with the golden output is because the test is expecting an
umask of 0022 where the write bit is not set for owner group, but with
a umask of 0002 for example, the write bit is set for the owner group.

Fix this by making the test set a umask of 0022, so that it works for
any system or user defined umask.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/740: move checking for a scratch device up
Christoph Hellwig [Fri, 13 Jun 2025 06:14:17 +0000 (08:14 +0200)]
generic/740: move checking for a scratch device up

Commit 3ae8a19f97d0 ("generic/740: enable by default") moved these checks
down accidentally.  Move them back up to make the test exit gracefully
when no scratch device is provided.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/032: fix failure due to attempt to wait for non-child process
Filipe Manana [Wed, 28 May 2025 11:42:20 +0000 (12:42 +0100)]
generic/032: fix failure due to attempt to wait for non-child process

Running generic/032 can sporadically fail like this:

  generic/032 11s ... - output mismatch (see /home/fdmanana/git/hub/xfstests/results//generic/032.out.bad)
      --- tests/generic/032.out   2023-03-02 21:47:53.884609618 +0000
      +++ /home/fdmanana/git/hub/xfstests/results//generic/032.out.bad    2025-05-28 10:39:34.549499493 +0100
      @@ -1,5 +1,6 @@
       QA output created by 032
       100 iterations
      +/home/fdmanana/git/hub/xfstests/tests/generic/032: line 90: wait: pid 3708239 is not a child of this shell
       000000 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd  >................<
       *
       100000
      ...
      (Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/generic/032.out /home/fdmanana/git/h

This is because we are attempting to wait for a process that is not a
child process of the test process and it's instead a child of a process
spawned by the test.

To make sure that after we kill the process running _syncloop() there
isn't any xfs_io process still running syncfs, add instead a trap to
to _syncloop() that waits for xfs_io to finish before the process running
that function exits.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agosrc/fill2: fix segfault during fopen error cleanup
Anthony Iliopoulos [Thu, 12 Jun 2025 19:05:13 +0000 (21:05 +0200)]
src/fill2: fix segfault during fopen error cleanup

When fill2 fails to open the output file (e.g. due to ENOSPC), it jumps
into the cleanup code where it attempts to call fclose, and this causes
a segfault within the glibc fclose code as it attempts to deref a null
pointer.

Fix it by conditionally calling fclose on the file pointer only when
non-null.

This is consistently reproducible with xfs/041.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agoxfs/603: add _require_scrub
Xinjian Ma [Tue, 10 Jun 2025 09:11:34 +0000 (17:11 +0800)]
xfs/603: add _require_scrub

This test uses xfs_scrub which is an EXPERIMENTAL and unstable feature.
Add _require_scrub to check if the system supports it.

Signed-off-by: Xinjian Ma <maxj.fnst@fujitsu.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/633: add _require_chown
Yuezhang Mo [Fri, 13 Jun 2025 13:52:10 +0000 (21:52 +0800)]
generic/633: add _require_chown

For file systems that do not support chown, such as exfat,
running this test does not make sense and should be skipped.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Friendy Su <friendy.su@sony.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/622: fix for exfat
Yuezhang Mo [Fri, 6 Jun 2025 10:28:55 +0000 (18:28 +0800)]
generic/622: fix for exfat

After commit(f761fcdd289d exfat: Implement sops->shutdown and
ioctl), shutdown is supported by exfat, this test can be run, but
fails because exfat has a 2 second granularity for access_time
and no timestamps for metadata changes.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/689: add _require_acls
Yuezhang Mo [Fri, 6 Jun 2025 10:35:17 +0000 (18:35 +0800)]
generic/689: add _require_acls

Before testing for ACLs, check whether the file system supports it
with _require_acls.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/738 : add missing _fixed_by_git_commit line to the test
Li Chen [Tue, 10 Jun 2025 02:52:42 +0000 (10:52 +0800)]
generic/738 : add missing _fixed_by_git_commit line to the test

Add the usual  _fixed_by_kernel_commit  line so the user can find
that the hang is cured by

    ab23a7768739  ("xfs: per-cpu deferred inode inactivation queues")

The hung task call trace would be as below:
[   20.535519]       Not tainted 5.14.0-rc4+ #27
[   20.537855] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[   20.539420] task:738             state:D stack:14544 pid: 7124 ppid:   753 flags:0x00004002
[   20.540892] Call Trace:
[   20.541424]  __schedule+0x22d/0x6c0
[   20.542128]  schedule+0x3f/0xa0
[   20.542751]  percpu_rwsem_wait+0x100/0x130
[   20.543516]  ? percpu_free_rwsem+0x30/0x30
[   20.544259]  __percpu_down_read+0x44/0x50
[   20.545002]  xfs_trans_alloc+0x19a/0x1f0
[   20.545747]  xfs_free_eofblocks+0x47/0x100
[   20.546519]  xfs_inode_mark_reclaimable+0x115/0x160
[   20.547398]  destroy_inode+0x36/0x70
[   20.548077]  prune_icache_sb+0x79/0xb0
[   20.548789]  super_cache_scan+0x159/0x1e0
[   20.549536]  shrink_slab.constprop.0+0x1b1/0x370
[   20.550363]  drop_slab_node+0x1d/0x40
[   20.551041]  drop_slab+0x30/0x70
[   20.551600]  drop_caches_sysctl_handler+0x6b/0x80
[   20.552311]  proc_sys_call_handler+0x12b/0x250
[   20.552931]  new_sync_write+0x117/0x1b0
[   20.553462]  vfs_write+0x1bd/0x250
[   20.553914]  ksys_write+0x5a/0xd0
[   20.554381]  do_syscall_64+0x3b/0x90
[   20.554854]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[   20.555481] RIP: 0033:0x7f90928d3300
[   20.555946] RSP: 002b:00007ffc2b50b998 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
[   20.556853] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f90928d3300
[   20.557686] RDX: 0000000000000002 RSI: 000055a5d6c47750 RDI: 0000000000000001
[   20.558524] RBP: 000055a5d6c47750 R08: 0000000000000007 R09: 0000000000000073
[   20.559335] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000002
[   20.560154] R13: 00007f90929ae760 R14: 0000000000000002 R15: 00007f90929a99e0

localhost login: [   30.773559] INFO: task 738:7124 blocked for more than 20 seconds.
[   30.775236]       Not tainted 5.14.0-rc4+ #27
[   30.777449] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[   30.779729] task:738             state:D stack:14544 pid: 7124 ppid:   753 flags:0x00004002
[   30.781267] Call Trace:
[   30.781850]  __schedule+0x22d/0x6c0
[   30.782618]  schedule+0x3f/0xa0
[   30.783297]  percpu_rwsem_wait+0x100/0x130
[   30.784110]  ? percpu_free_rwsem+0x30/0x30
[   30.785085]  __percpu_down_read+0x44/0x50
[   30.786071]  xfs_trans_alloc+0x19a/0x1f0
[   30.786877]  xfs_free_eofblocks+0x47/0x100
[   30.787727]  xfs_inode_mark_reclaimable+0x115/0x160
[   30.788708]  destroy_inode+0x36/0x70
[   30.789395]  prune_icache_sb+0x79/0xb0
[   30.790056]  super_cache_scan+0x159/0x1e0
[   30.790712]  shrink_slab.constprop.0+0x1b1/0x370
[   30.791381]  drop_slab_node+0x1d/0x40
[   30.791924]  drop_slab+0x30/0x70
[   30.792469]  drop_caches_sysctl_handler+0x6b/0x80
[   30.793328]  proc_sys_call_handler+0x12b/0x250
[   30.793948]  new_sync_write+0x117/0x1b0
[   30.794471]  vfs_write+0x1bd/0x250
[   30.794941]  ksys_write+0x5a/0xd0
[   30.795414]  do_syscall_64+0x3b/0x90
[   30.795928]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[   30.796595] RIP: 0033:0x7f90928d3300
[   30.797090] RSP: 002b:00007ffc2b50b998 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
[   30.798033] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f90928d3300
[   30.798852] RDX: 0000000000000002 RSI: 000055a5d6c47750 RDI: 0000000000000001
[   30.799703] RBP: 000055a5d6c47750 R08: 0000000000000007 R09: 0000000000000073
[   30.800833] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000002
[   30.801764] R13: 00007f90929ae760 R14: 0000000000000002 R15: 00007f90929a99e0
[   30.802628] INFO: task xfs_io:7130 blocked for more than 10 seconds.
[   30.803421]       Not tainted 5.14.0-rc4+ #27
[   30.803985] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[   30.804979] task:xfs_io          state:D stack:13712 pid: 7130 ppid:  7127 flags:0x00000002
[   30.806013] Call Trace:
[   30.806399]  __schedule+0x22d/0x6c0
[   30.806867]  schedule+0x3f/0xa0
[   30.807334]  rwsem_down_write_slowpath+0x1d8/0x510
[   30.808018]  thaw_super+0xd/0x20
[   30.808748]  __x64_sys_ioctl+0x5d/0xb0
[   30.809292]  do_syscall_64+0x3b/0x90
[   30.809797]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[   30.810454] RIP: 0033:0x7ff1b48c5d1b
[   30.810943] RSP: 002b:00007fff0bf88ac0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[   30.811874] RAX: ffffffffffffffda RBX: 000055b93ae5fc40 RCX: 00007ff1b48c5d1b
[   30.812743] RDX: 00007fff0bf88b2c RSI: ffffffffc0045878 RDI: 0000000000000003
[   30.813583] RBP: 000055b93ae60fe0 R08: 0000000000000000 R09: 0000000000000000
[   30.814497] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
[   30.815413] R13: 000055b93a3a94e9 R14: 0000000000000000 R15: 000055b93ae61150

Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agoext4/002: make generic to support xfs
Hans Holmberg [Mon, 9 Jun 2025 11:03:54 +0000 (11:03 +0000)]
ext4/002: make generic to support xfs

xfs supports separate log devices and as this test now passes, share
it by turning it into a generic test.

This should not result in a new failure for other file systems as only
ext2/ext3/ext4 and xfs supports mkfs with SCRATCH_LOGDEVs.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agoxfs: add mount test for read only rt devices
Hans Holmberg [Mon, 9 Jun 2025 11:03:53 +0000 (11:03 +0000)]
xfs: add mount test for read only rt devices

Make sure that we can mount rt devices read-only if them themselves
are marked as read-only.

Also make sure that rw re-mounts are not allowed if the device is
marked as read-only.

Based on generic/050.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agofstests: generic/741: make cleanup to handle test failure properly v2025.06.08
Qu Wenruo [Wed, 4 Jun 2025 23:55:24 +0000 (09:25 +0930)]
fstests: generic/741: make cleanup to handle test failure properly

[BUG]
When I was tinkering the bdev open holder parameter, it caused a bug
that it no longer rejects mounting the underlying device of a
device-mapper.

And the test case properly detects the regression:

generic/741 1s ... umount: /mnt/test: target is busy.
_check_btrfs_filesystem: filesystem on /dev/mapper/test-test is inconsistent
(see /home/adam/xfstests/results//generic/741.full for details)
Trying to repair broken TEST_DEV file system
_check_btrfs_filesystem: filesystem on /dev/mapper/test-scratch1 is inconsistent
(see /home/adam/xfstests/results//generic/741.full for details)
- output mismatch (see /home/adam/xfstests/results//generic/741.out.bad)
    --- tests/generic/741.out 2024-04-06 08:10:44.773333344 +1030
    +++ /home/adam/xfstests/results//generic/741.out.bad 2025-06-05 09:18:03.675049206 +0930
    @@ -1,3 +1,2 @@
     QA output created by 741
    -mount: TEST_DIR/extra_mnt: SCRATCH_DEV already mounted or mount point busy
    -mount: TEST_DIR/extra_mnt: SCRATCH_DEV already mounted or mount point busy
    +rm: cannot remove '/mnt/test/extra_mnt': Device or resource busy
    ...
    (Run 'diff -u /home/adam/xfstests/tests/generic/741.out /home/adam/xfstests/results//generic/741.out.bad'  to see the entire diff)

The problem is, all later test will fail, because the $SCRATCH_DEV is
still mounted at $extra_mnt:

 TEST_DEV=/dev/mapper/test-test is mounted but not on TEST_DIR=/mnt/test - aborting
 Already mounted result:
 /dev/mapper/test-test /mnt/test /dev/mapper/test-test /mnt/test

[CAUSE]
The test case itself is doing two expected-to-fail mounts, but the
cleanup function is only doing unmount once, if the mount succeeded
unexpectedly, the $SCRATCH_DEV will be mounted at $extra_mnt forever.

[ENHANCEMENT]
To avoid screwing up later test cases, do the $extra_mnt cleanup twice
to handle the unexpected mount success.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/699: fix failure with MOUNT_OPTIONS
Amir Goldstein [Tue, 3 Jun 2025 10:07:45 +0000 (12:07 +0200)]
generic/699: fix failure with MOUNT_OPTIONS

generic/699 uses overalyfs helper _overlay_mount_dirs, which is meant to
be used by overlayfs tests, where MOUNT_OPTIONS refer to overalyfs mount
options.

Using this helper from a generic test when FSTYP is not overlay is
causing undesired results. For example, when MOUNT_OPTIONS is defined
and includes a mount option not supported by overalyfs (e.g. 'acl'),
the test is notrun because of:

mount: /vdc/ovl-merge: fsconfig() failed: overlay: Unknown parameter 'acl'.

There is no other generic test that includes the common/overlay helpers
and uses them, so remove this practice from generic/699 as well.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric: remove incorrect _require_idmapped_mounts checks
Amir Goldstein [Mon, 26 May 2025 17:54:37 +0000 (19:54 +0200)]
generic: remove incorrect _require_idmapped_mounts checks

commit f5661920 ("generic: add missed _require_idmapped_mounts check")
wrongly adds _require_idmapped_mounts to tests that do not require
idmapped mounts support.

The added _require_idmapped_mounts in test generic/633 goes against
commit d8dee122 ("idmapped-mounts: always run generic vfs tests")
that intentionally removed this requirement from the generic tests.

The added _require_idmapped_mounts in tests generic/69{6,7} causes
those tests not to run with overlayfs, which does not support idmapped
mounts. However, those tests are regression tests to kernel commit
1639a49ccdce ("fs: move S_ISGID stripping into the vfs_*() helpers")
which is documented as also solving a correction issue with overlayfs,
so removing this test converage is very much undesired.

Remove the incorrectly added _require_idmapped_mounts checks.
Also fix the log in _require_idmapped_mounts to say that
"idmapped mounts not support by $FSTYP", which is what the helper
checks instead of "vfstests not support by $FSTYP" which is incorrect.

Cc: Yang Xu <xuyang2018.jy@fujitsu.com>
Cc: Anthony Iliopoulos <ailiop@suse.com>
Cc: David Disseldorp <ddiss@suse.de>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/604: do not run with overlayfs
Amir Goldstein [Tue, 3 Jun 2025 10:07:42 +0000 (12:07 +0200)]
generic/604: do not run with overlayfs

Overlayfs does not allow mounting over again with the same layers
until umount is fully completed, so is not appropriate for this test
which tries to mount in parallel to umount.

This is manifested as the test failure below when overlayfs strict mount
checks are enabled by enabling the index feature:

$ echo Y > /sys/module/overlay/parameters/index
...
    +mount: /vdf/ovl-mnt: /vdf already mounted or mount point busy.
    +       dmesg(1) may have more information after failed mount system call.
    +mount /vdf /vdf/ovl-mnt failed

Opt-out of this test with overlayfs and remove the hacks that were placed
by commit 06cee932 ("generic/604: Fix for overlayfs") to make the test pass
with overlayfs in the first place.

Tested-by: André Almeida <andrealmeid@igalia.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agooverlay: fix regression in _repair_overlay_scratch_fs
Amir Goldstein [Tue, 3 Jun 2025 10:07:41 +0000 (12:07 +0200)]
overlay: fix regression in _repair_overlay_scratch_fs

_repair_overlay_scratch_fs assumed that the base fs is mounted.
This was a wrong assumption to make, and that was exposed by commit
4c6bc456 ("fstests: clean up mount and unmount operations") that
converted open coded umount in generic/332 to _scratch_unmount.

After this change, there errors were observed when running generic/332
if fsck.overlay is installed:

     Check for damage
    +fsck.overlay:[Error]: Faile to resolve upperdir:/vdf/ovl-upper:
                           No such file or directory
    +fsck.overlay failed, err=8
    +umount: /vdf: not mounted.

Fix this by making sure that base fs is mounted before running the
layers check and fix test generic/330 to conform with the umount
conversion patch.

Fixes: 4c6bc456 ("fstests: clean up mount and unmount operations")
Tested-by: André Almeida <andrealmeid@igalia.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agooverlay: workaround libmount failure to remount,ro
Amir Goldstein [Tue, 3 Jun 2025 10:07:40 +0000 (12:07 +0200)]
overlay: workaround libmount failure to remount,ro

libmount >= v1.39 calls several unneeded fsconfig() calls to reconfigure
lowerdir/upperdir when user requests only -o remount,ro.

Those calls fail because overlayfs does not allow making any config
changes with new mount api, besides MS_RDONLY.

We workaround this problem with --options-mode ignore.

Reported-by: André Almeida <andrealmeid@igalia.com>
Suggested-by: Karel Zak <kzak@redhat.com>
Link: https://lore.kernel.org/linux-fsdevel/20250521-ovl_ro-v1-1-2350b1493d94@igalia.com/
Link: https://lore.kernel.org/fstests/CAJfpegtJ3SDKmC80B4AfWiC3JmtWdW2+78fRZVtsuhe-wSRPvg@mail.gmail.com/
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agofsstress: print syncfs() return value in verbose mode
Filipe Manana [Fri, 23 May 2025 17:20:50 +0000 (18:20 +0100)]
fsstress: print syncfs() return value in verbose mode

We aren't logging the syncfs() return value in case we are running in
verbose mode, which is useful and it would help me immediately figuring
out it was failing in a problem I was debugging with btrfs.

So log its return value, just like we do for every other fsstress command.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agof2fs/014: test for missing 'trimmed' flag issue
Chunhai Guo [Mon, 26 May 2025 08:03:23 +0000 (02:03 -0600)]
f2fs/014: test for missing 'trimmed' flag issue

This is a regression test case to verify whether the CP_TRIMMED_FLAG is
properly set after performing the following steps:
1. mount the f2fs filesystem
2. create a file, write data to it, then delete the file
3. unmount the filesystem
4. verify that the 'trimmed' flag is set in the checkpoint state

We should apply the commit ("f2fs: fix missing discard for active
segments") to resolve the issue where the 'trimmed' flag is missing.

Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agof2fs/004: avoid race condition in test
Jan Prusakowski [Fri, 30 May 2025 09:23:49 +0000 (09:23 +0000)]
f2fs/004: avoid race condition in test

In current implementation the atomic write may not start before
the direct write and the test fails.

The patch adds a delay after starting the atomic write process
so it has a chance to actually start wrtiting data and set the
internal state of the file correctly.

Signed-off-by: Jan Prusakowski <jprusakowski@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/094: fix test ignoring failures
Filipe Manana [Thu, 29 May 2025 11:33:13 +0000 (12:33 +0100)]
generic/094: fix test ignoring failures

The test is ignoring failures completely:

1) If mounting the scratch device fails it redirects both stdout and
   stderr to /dev/null, so it gets unnoticed and the test runs against
   a different fs than expected (in my test environment $SCRATCH_MNT
   points to a directory in an ext4 fs for example but I want to test
   btrfs);

2) We are redirecting the stdout and stderr of fiemap-tester to the
   $seqres.full file, so if it fails it gets completely unnoticed and
   the test succeeds.

For the first issue fix this by not even using the scratch filesystem and
use instead the test filesystem, since the test creates a 2M file which
is small enough.

For the second issue simply don't redirect the stdout and stderr, so that
if the test program fails it causes a mismatch with the golden output,
making the test fail.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agofstests: add kernel commit IDs to some tests
Filipe Manana [Thu, 29 May 2025 11:13:41 +0000 (12:13 +0100)]
fstests: add kernel commit IDs to some tests

The kernel fixes exercised by some tests have already landed in Linus'
tree, so update the tests with the respective commit IDs.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/645: add _require_chown
Yuezhang Mo [Wed, 28 May 2025 09:15:29 +0000 (17:15 +0800)]
generic/645: add _require_chown

This test uses chown to set GID and UID, which requires chown
support, so add _require_chown to check for chown support.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Friendy Su <friendy.su@sony.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/730: add _require_scratch_shutdown
Yuezhang Mo [Wed, 28 May 2025 09:15:28 +0000 (17:15 +0800)]
generic/730: add _require_scratch_shutdown

Before testing for shutdown, check whether the file system
supports it with _require_scratch_shutdown.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Friendy Su <friendy.su@sony.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/755: add _require_hardlinks
Yuezhang Mo [Wed, 28 May 2025 09:15:27 +0000 (17:15 +0800)]
generic/755: add _require_hardlinks

This test is used to test whether the ctime of the original file
changes after deleting its hard link, which requires hardlink
support, so add _require_hardlinks to check for hardlink support.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Friendy Su <friendy.su@sony.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/754: add _require_symlinks
Yuezhang Mo [Wed, 28 May 2025 09:15:26 +0000 (17:15 +0800)]
generic/754: add _require_symlinks

This test tests whether xattrs can be added to a symbolic link,
which requires symlink support, so add _require_symlinks to check
for symlink support.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Friendy Su <friendy.su@sony.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/656: add _require_chown
Yuezhang Mo [Wed, 28 May 2025 09:15:25 +0000 (17:15 +0800)]
generic/656: add _require_chown

This test uses chown to set GID and UID, which requires chown
support, so add _require_chown to check for chown support.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Friendy Su <friendy.su@sony.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/696: add _require_chmod
Yuezhang Mo [Wed, 28 May 2025 09:15:24 +0000 (17:15 +0800)]
generic/696: add _require_chmod

This test uses chmod to set the S_ISGID bit, which requires chmod
support, so add _require_chmod to check for chmod support.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Friendy Su <friendy.su@sony.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agocommon/atomicwrites: fix _require_scratch_write_atomic
Darrick J. Wong [Mon, 2 Jun 2025 19:22:14 +0000 (12:22 -0700)]
common/atomicwrites: fix _require_scratch_write_atomic

Fix this function to call _notrun whenever something fails.  If we can't
figure out the atomic write geometry, then we haven't satisfied the
preconditions for the test.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agocommon/atomicwrites: adjust a few more things
Darrick J. Wong [Mon, 2 Jun 2025 19:22:13 +0000 (12:22 -0700)]
common/atomicwrites: adjust a few more things

Always export STATX_WRITE_ATOMIC so anyone can use it, make the "cp
reflink" logic work for any filesystem, not just xfs, and create a
separate helper to check that the necessary xfs_io support is present.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/765: move common atomic write code to a library file
Darrick J. Wong [Mon, 2 Jun 2025 19:22:12 +0000 (12:22 -0700)]
generic/765: move common atomic write code to a library file

Move the common atomic writes code to common/atomicwrites so we can share
them.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/765: adjust various things
Darrick J. Wong [Mon, 2 Jun 2025 19:22:11 +0000 (12:22 -0700)]
generic/765: adjust various things

Fix some bugs when detecting the atomic write geometry, record what
atomic write geometry we're testing each time through the loop, and
create a group for atomic writes tests.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
3 months agogeneric/765: fix a few issues
Darrick J. Wong [Mon, 2 Jun 2025 19:22:10 +0000 (12:22 -0700)]
generic/765: fix a few issues

Fix a few bugs in the single block atomic writes test, such as not requiring
directio, using the page size for the ext4 max bsize, and making sure we check
the max atomic write size.

Cc: ritesh.list@gmail.com
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoopen_by_handle: add a test for connectable file handles v2025.05.25
Amir Goldstein [Fri, 9 May 2025 17:04:56 +0000 (19:04 +0200)]
open_by_handle: add a test for connectable file handles

This is a variant of generic/477 with connectable file handles.
This test uses load and store of file handles from a temp file to test
decoding connectable file handles after cycle mount and after renames.

Decoding connectable file handles after being moved to a new parent
is expected to fail on some filesystems, but not on filesystems that
do not really get unmounted in mount cycle like tmpfs, so skip this test.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoopen_by_handle: add support for testing connectable file handles
Amir Goldstein [Fri, 9 May 2025 17:00:32 +0000 (19:00 +0200)]
open_by_handle: add support for testing connectable file handles

Test for kernel and filesystem support for conenctable file handles.

With -N flag, encode connectable file handles and fail the test if the
kernel or filesystem do not support conenctable file handles.

Verify that decoding connectable file handles always results in a non
empty path of the fd.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agofstests: btrfs/020: use device pool to avoid busy TEST_DEV
Qu Wenruo [Tue, 13 May 2025 23:03:01 +0000 (08:33 +0930)]
fstests: btrfs/020: use device pool to avoid busy TEST_DEV

[BUG]
There is an internal report about btrfs/020 failure, the 020.full looks
like this:

  ERROR: ioctl(DEV_REPLACE_START) failed on "/opt/test/020.5968.mnt": Read-only file system

  Performing full device TRIM /dev/loop8 (256.00MiB) ...
  _check_btrfs_filesystem: filesystem on /dev/loop0 is inconsistent
  *** fsck.btrfs output ***
  ERROR: /dev/loop0 is currently mounted, use --force if you really intend to check the filesystem
  Opening filesystem to check...
  *** end fsck.btrfs output
  *** mount output ***
  [...]
  /dev/loop0 on /opt/test type btrfs (rw,relatime,seclabel,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/)
  *** end mount output

[CAUSE]
Unfortunately I can not reproduce the situation here, but it looks like
by somehow we didn't unmount the TEST_DEV before checking it.

This may or may not be caused by the fact we're using loop back devices
on TEST_MNT.

[FIX]
For this particluar test case, we really do not need to use TEST_MNT and
create complex loopback devices.

We can just ask for 3 devices from the device pool, use 2 for the raid1
fs, and then use the spare one for dev replace.

This should greately simplify the test case setup and cleanup, thus
avoid the above busy TEST_DEV and false test failure.

Furthermore use the golden output to match the error message, and since
we're here also handle a bug in btrfs-progs where the error message is
incorrectly split into two lines.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
4 months agofstests: btrfs/220: do not use nologreplay when possible
Qu Wenruo [Tue, 13 May 2025 07:07:49 +0000 (16:37 +0930)]
fstests: btrfs/220: do not use nologreplay when possible

[BUG]
If the system is using mount from util-linux 2.41 or newer, the test
case will fail with the following error:

  FSTYP         -- btrfs
  PLATFORM      -- Linux/x86_64 btrfs-vm 6.15.0-rc5-custom+ #238 SMP PREEMPT_DYNAMIC Wed May  7 14:10:51 ACST 2025
  MKFS_OPTIONS  -- /dev/mapper/test-scratch1
  MOUNT_OPTIONS -- /dev/mapper/test-scratch1 /mnt/scratch

  btrfs/220 6s ... - output mismatch (see /home/adam/xfstests/results//btrfs/220.out.bad)
      --- tests/btrfs/220.out 2022-05-11 11:25:30.749999997 +0930
      +++ /home/adam/xfstests/results//btrfs/220.out.bad 2025-05-13 16:26:18.068521503 +0930
      @@ -1,2 +1,4 @@
       QA output created by 220
      +mount warning:
      +      * btrfs: Deprecated parameter 'nologreplay'
       Silence is golden
      ...
      (Run 'diff -u /home/adam/xfstests/tests/btrfs/220.out /home/adam/xfstests/results//btrfs/220.out.bad'  to see the entire diff)
  Ran: btrfs/220
  Failures: btrfs/220
  Failed 1 of 1 tests

[CAUSE]
The newer mount command provides the extra ability to show warning during
mount.

Although btrfs still supports "nologreplay" mount option to keep
consistency with other filesystems, we will output a warning and
encourage users to use "rescue=nologreplay" instead.

During "nologreplay" mount option test, normally we will mount use
the newer "rescue=nologreplay" mount option if the kernel supports.

But the following two call sites are still unconditionally utilizing
the deprecated "nologreplay" mount option directly:

- Expected failure when using nologreplay and rw mount

- Mount option verification that "nologreplay" is converted to
  "rescue=nologreplay"

The second call site caused the above mount warning message and fail the
test case.

[FIX]
If the kernel supports "rescue=nologreplay" we should not utilized
"nologreplay" at all.

This will avoid the mount warning on the deprecated and discouraged
"nologreplay" mount option.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
4 months agofstests: btrfs: add git commit ID to btrfs/335
Johannes Thumshirn [Mon, 12 May 2025 06:07:49 +0000 (08:07 +0200)]
fstests: btrfs: add git commit ID to btrfs/335

Now that kernel commit 'b0c26f479926 ("btrfs: zoned: return EIO on RAID1 block
group write pointer mismatch")' is merged, add git commit ID to fstests
btrfs/335 and also add the test to the auto group.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agofstests: btrfs: a new test case to verify scrub and rescue=idatacsums
Qu Wenruo [Mon, 12 May 2025 09:39:10 +0000 (19:09 +0930)]
fstests: btrfs: a new test case to verify scrub and rescue=idatacsums

There is a kernel bug report that scrub will trigger a NULL pointer
dereference when rescue=idatacsums mount option is provided.

Add a test case for such situation, to verify kernel can gracefully
reject scrub when  there is no csum tree.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agobtrfs/023: add to the quick group
Filipe Manana [Thu, 15 May 2025 11:50:08 +0000 (12:50 +0100)]
btrfs/023: add to the quick group

This is a very quick test, so add it to the quick group.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agobtrfs: add tests that exercise raid profiles to the raid group
Filipe Manana [Thu, 15 May 2025 11:50:07 +0000 (12:50 +0100)]
btrfs: add tests that exercise raid profiles to the raid group

Many tests (in fact most) that exercise one or more raid profiles are not
tagged in the raid group. Tag them with the raid group so that we can
easily run only raid test with "./check -g raid" when testing changes that
affect only raid code.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agonew: Replace "status=0; exit 0" with _exit 0
Nirjhar Roy (IBM) [Thu, 22 May 2025 05:41:35 +0000 (05:41 +0000)]
new: Replace "status=0; exit 0" with _exit 0

We should now start using _exit 0 for every new test
that we add.

Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agonew: Add a new parameter (copyright-owner) in the "new" script
Nirjhar Roy (IBM) [Thu, 22 May 2025 05:41:34 +0000 (05:41 +0000)]
new: Add a new parameter (copyright-owner) in the "new" script

This patch another optional interactive prompt to enter the
copyright-owner for each new test file that is created using
the "new" file.

The sample output looks like something like the following:

./new selftest
Next test id is 007
Append a name to the ID? Test name will be 007-$name. y,[n]:
Creating test file '007'
Add to group(s) [auto] (separate by space, ? for list): selftest quick
Enter <copyright owner>: IBM Corporation
Creating skeletal script for you to edit ...
 done.

Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agof2fs/013: test to check potential corruption on atomic_write file
Chao Yu [Fri, 9 May 2025 06:07:54 +0000 (14:07 +0800)]
f2fs/013: test to check potential corruption on atomic_write file

This is a regression testcase to check whether we will handle database
inode dirty status correctly:
1. mount f2fs image w/ timeout fault injection option
2. create a regular file, and write data into the file
3. start transaction on the file (via F2FS_IOC_START_ATOMIC_WRITE)
4. write transaction data to the file
5. commit and end the transaction (via F2FS_IOC_COMMIT_ATOMIC_WRITE)
6. meanwhile loop call fsync in parallel
Before f098aeba04c9 ("f2fs: fix to avoid atomicity corruption of atomic
file"), database file may become corrupted after atomic write while
there is concurrent dirty inode flush in background.

Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agocheck: check and fix the test filesystem after failed tests
Darrick J. Wong [Wed, 21 May 2025 22:42:54 +0000 (15:42 -0700)]
check: check and fix the test filesystem after failed tests

Currently, ./check calls _check_filesystems after a test passes to make
sure that the test and scratch filesystems are ok, and repairs the test
filesystem if it's not ok.

However, we don't do this for failed tests.  If a test fails /and/
corrupts the test filesystem, every subsequent passing test will be
marked as a failure because of latent corruptions on the test
filesystem.

This is a little silly, so let's call _check_filesystems on the test
filesystem after a test fail so that the badness doesn't spread.

Cc: fstests@vger.kernel.org # v2023.05.01
Fixes: 4a444bc19a836f ("check: _check_filesystems for errors even if test failed")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agocheck: unbreak iam
Darrick J. Wong [Wed, 21 May 2025 22:42:38 +0000 (15:42 -0700)]
check: unbreak iam

I don't know why this change was made:

iam=check

to

iam=check.$$

The only users of this variable are:

check:36:iam=check
check:52:rm -f $tmp.list $tmp.tmp $tmp.grep $here/$iam.out $tmp.report.* $tmp.arglist
common/btrfs:216:               if [ "$iam" != "check" ]; then
common/overlay:407:             if [ "$iam" != "check" ]; then
common/rc:3565: if [ "$iam" != "check" ]; then
common/xfs:1021:                if [ "$iam" != "check" ]; then
new:9:iam=new

None of them were ported to notice the pid.  Consequently,
_check_generic_filesystem (aka _check_test_fs on an ext4 filesystem)
failing will cause ./check to exit the entire test suite when the test
filesystem is corrupt.  That's not what we wanted, particularly since
Leah added a patch to repair the test filesystem between tests.

Cc: fstests@vger.kernel.org # v2024.12.08
Fixes: fa0e9712283f0b ("fstests: check-parallel")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agogeneric/251: skip this test if fstrim geometry detection fails
Darrick J. Wong [Wed, 21 May 2025 22:42:23 +0000 (15:42 -0700)]
generic/251: skip this test if fstrim geometry detection fails

There's no reason to wait until fstrim_loop to detect the length
constraints on the FITRIM call since failing to detect any constraints
just leads to _notrun.  Run that stuff from the top level scope so that
we don't start up a bunch of exercisers for no good reason.

Cc: fstests@vger.kernel.org # v2023.10.29
Fixes: 95b0db739400c2 ("generic/251: check min and max length and minlen for FSTRIM")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agogeneric/251: fix infinite looping if fstrim_loop configuration fails
Darrick J. Wong [Wed, 21 May 2025 22:42:07 +0000 (15:42 -0700)]
generic/251: fix infinite looping if fstrim_loop configuration fails

In generic/251, the topmost scope of the test creates a run file
($tmp.fstrim_loop), starts fstrim_loop as a background shell, and then
waits for the file to disappear.  Unfortunately, the set_*_constraints
helpers called by fstrim_loop can abort the subshell by invoking
_notrun, in which case the loop never deletes the runfile and the upper
scope waits forever.

Fix this by amending _destroy_fstrim to delete the runfile always, and
move the trap call to the top of the function with a note about why it
must always be called.

Oh but wait, there's a second runfile related bug in run_process -- if
the fstrim loop exits while run_process is looping, it'll keep looping
even though there isn't anything else going on.  Break out of the loopin
this case.

Oh but wait, there's a /third/ runfile bug -- if the fstrim_loop exits
before the run_process children, it will delete the runfile.  Then the
top level scope, in trying to empty out the runfile to get the
fstrim_loop to exit, recreates the runfile and waits forever for nobody
to delete the run file.

I hate process management in bash.

Cc: fstests@vger.kernel.org # v2024.12.01
Fixes: 2d6e7681acff1e ("generic/251: use sentinel files to kill the fstrim loop")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agofstests: add a mmap test group
Filipe Manana [Wed, 14 May 2025 17:13:32 +0000 (18:13 +0100)]
fstests: add a mmap test group

Add a mmap group to tag tests that exercise memory mapped reads/writes, so
that it's easy to filter and run tests that exercise map:

   ./check -g mmap

Very useful during development to quickly test changes to a filesystem's
mmap implementation.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agofstests: generic/537: remove the btrfs specific mount option
Qu Wenruo [Mon, 19 May 2025 05:28:39 +0000 (14:58 +0930)]
fstests: generic/537: remove the btrfs specific mount option

Although btrfs deprecated "norecovery" mount option in upstream kernel
commit a1912f712188 ("btrfs: remove code for inode_cache and recovery
mount options"), later "norecovery" mount option is re-introduced for
compatibility by commit 440861b1a03c ("btrfs: re-introduce 'norecovery'
mount option").

Instead the btrfs specific mount option "nologreplay" is already
deprecated for a long time and is going to be removed soon.

So use the generic "norecovery" for all filesystems.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: skip test that want to mdrestore to block devices on zoned devices
Christoph Hellwig [Tue, 13 May 2025 05:19:33 +0000 (07:19 +0200)]
xfs: skip test that want to mdrestore to block devices on zoned devices

mdrestore doesn't work on zoned device, so skip tests using to
pre-populate a file system image.

This was previously papered over by requiring fallocate, which got
removed in commit eff1baf42a79 ("common/populate: drop fallocate mode 0
requirement").

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agotests/selftest: Add a new pseudo flaky test.
Nirjhar Roy (IBM) [Fri, 10 Jan 2025 09:10:25 +0000 (09:10 +0000)]
tests/selftest: Add a new pseudo flaky test.

This test is to simulate the behavior of a flaky test. This will be required
when we will make some modifications to the pass/fail metric calculation of
the test infrastructure where we will need a test with non-zero pass
and non-zero failure rate.

Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agof2fs/012: test red heart lookup v2025.05.11
Chao Yu [Wed, 7 May 2025 05:36:42 +0000 (13:36 +0800)]
f2fs/012: test red heart lookup

As Han Qi reported in bugzilla [1], commit 5c26d2f1d3f5 ("unicode: Don't
special case ignorable code points") changes logic to handle ignorable
code points, when we handle filename which has special unicode charactor
like red heart ❤️, utf8_casefold() may return different length than in the
past, result in that f2fs cacluates hash code incorreclty, eventually,
filename w/ special unicode charactor will not be found w/ the wrong hash
code.

f2fs has introduced a linear lookup fallback w/ commit 91b587ba79e1
("f2fs: Introduce linear search for dentries"), once hash-based lookup
fails, it tries linear lookup as a fallback.

This patch can help to check whether linear lookup fallback works well
or not.

Firstly, we use below testcase to check how hash code changes:

mkfs.f2fs -f -O casefold -C utf8 /dev/vda
mount /dev/vda /mnt/f2fs
mkdir /mnt/f2fs/dir/
f2fs_io setflags casefold /mnt/f2fs/dir
touch /mnt/f2fs/dir/$'\u2764\ufe0f'
umount /mnt/f2fs
dump.f2fs -i 4 -d 3 /dev/vda
dump.f2fs -b $blkaddr_of_dir -d 3 /dev/vda

w/o ("unicode: Don't special case ignorable code points")
[dump_dirent: 991] bitmap pos[0x2] name[❤️] len[0x6] hash[0x19dd7132] ino[0x5] type[0x1]
[dump_dirent: 998] name(hex)[0xe2 0x9d 0xa4 0xef 0xb8 0x8f 0x0]

w/ ("unicode: Don't special case ignorable code points")
[dump_dirent: 991] bitmap pos[0x2] name[❤️] len[0x6] hash[0x9a2ea068] ino[0x5] type[0x1]
[dump_dirent: 998] name(hex)[0xe2 0x9d 0xa4 0xef 0xb8 0x8f 0x0]

Correct hash code: 0x19dd7132
Wrong hash code: 0x9a2ea068

So, we can test as below:

1. create file w/ red heart as its filename
2. inject wrong hash code to the file
3. disable linear lookup, expect lookup failure
4. enable linear lookup, expect lookup succeed

[1] https://bugzilla.kernel.org/show_bug.cgi?id=219586

Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Daniel Lee <chullee@google.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agogeneric/211: completely remove obsolete test and related code
Anthony Iliopoulos [Wed, 7 May 2025 11:18:12 +0000 (13:18 +0200)]
generic/211: completely remove obsolete test and related code

This was a regression test for a bug in fs/aio.c kernel code that could
cause kernel crashing and was fixed in commit 3e45a10919b3 ("aio: remove
incorrect initialization of "nr_pages"") more than 20 years ago (in
v2.6.10).

The test code was basically trying to trigger the bug by doing repeated
mmaps until it would exhaust the vm.max_map_count limit, after which the
aio_setup_ring() would fail its own internal mmap and branch into
aio_free_ring() where it would attempt to free pages that were not
allocated and crash the kernel.

The bug is was not really relevant to filesystems in the first place,
and further to its fix it was made not possible to trigger due to commit
3dc9acb67600 ("aio: clean up and fix aio_setup_ring page mapping").

The test currently triggers the oom killer on systems where the
vm.max_map_count limit has been increased significantly from the default
as it eventually exhausts the available memory. This could be trivially
fixed by lowering and then restoring the limit just for the duration of
the test, but since it no longer serves any purpose let's drop it
completely.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: test that we can handle spurious zone wp advancements
Hans Holmberg [Thu, 8 May 2025 05:34:45 +0000 (07:34 +0200)]
xfs: test that we can handle spurious zone wp advancements

Test that we can gracefully handle spurious zone write pointer
advancements while unmounted.

Any space covered by the wp unexpectedly moving forward should just
be treated as unused space, so check that we can still mount the file
system and that the zone will be reset when all used blocks have been
freed.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: test that truncate does not spuriously return ENOSPC
Christoph Hellwig [Thu, 8 May 2025 05:34:44 +0000 (07:34 +0200)]
xfs: test that truncate does not spuriously return ENOSPC

For zoned file systems, truncate to an offset not aligned to the block
size need to allocate a new block for zeroing the remainder.

Test that this allocation can dip into the reserved pool even when other
threads are waiting for space freed by GC.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: test that xfs_repair does not mess up the zone used counter
Christoph Hellwig [Thu, 8 May 2025 05:34:43 +0000 (07:34 +0200)]
xfs: test that xfs_repair does not mess up the zone used counter

Check that xfs_repair actually rebuilds the used counter after blowing
away the rmap inode and recreating it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: test zoned GC file defragmentation for random writers
Christoph Hellwig [Thu, 8 May 2025 05:34:42 +0000 (07:34 +0200)]
xfs: test zoned GC file defragmentation for random writers

Test that zoned GC defragments sequential writers forced into the same
zone.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: test zoned GC file defragmentation for sequential writers
Christoph Hellwig [Thu, 8 May 2025 05:34:41 +0000 (07:34 +0200)]
xfs: test zoned GC file defragmentation for sequential writers

Test that zoned GC defragments sequential writers forced into the same
zone.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: test zoned ENOSPC behavior with multiple writers
Christoph Hellwig [Thu, 8 May 2025 05:34:40 +0000 (07:34 +0200)]
xfs: test zoned ENOSPC behavior with multiple writers

Test that multiple parallel writers can't accidentally dip into the reserved
space pool.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: test zone stream separation for two buffered writers
Christoph Hellwig [Thu, 8 May 2025 05:34:39 +0000 (07:34 +0200)]
xfs: test zone stream separation for two buffered writers

Check that two parallel buffered sequential writers are separated into
different zones when writeback happens before closing the files.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: test zone stream separation for two direct writers
Christoph Hellwig [Thu, 8 May 2025 05:34:38 +0000 (07:34 +0200)]
xfs: test zone stream separation for two direct writers

Check that two parallel direct sequential writers are separated into
different zones.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: add a test for writeback after close
Christoph Hellwig [Thu, 8 May 2025 05:34:37 +0000 (07:34 +0200)]
xfs: add a test for writeback after close

Test that files written back after closing are packed tightly instead of
using up open zone resources.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: add a test for write lifetime hints
Christoph Hellwig [Thu, 8 May 2025 05:34:36 +0000 (07:34 +0200)]
xfs: add a test for write lifetime hints

Test that the zone allocator actually places by temperature bucket.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: add a test to check that data growfs fails with internal rt device
Christoph Hellwig [Thu, 8 May 2025 05:34:35 +0000 (07:34 +0200)]
xfs: add a test to check that data growfs fails with internal rt device

The internal RT device directly follows the data device on the same
block device.  This implies the data device can't be grown, and growfs
should handle this gracefully.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: add test to check for block layer reordering
Christoph Hellwig [Thu, 8 May 2025 05:34:34 +0000 (07:34 +0200)]
xfs: add test to check for block layer reordering

Zoned writes using zone append can be easily fragmented when the block
layer or the driver reorders I/O.  Check that a simple sequential
direct write creates a single extent.  This was broken in the kernel
until recently when using the ->commit_rqs interface on devices with
a relatively small max_hw_sectors / max_zone_append_sectors.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: add a zoned growfs test
Christoph Hellwig [Thu, 8 May 2025 05:34:33 +0000 (07:34 +0200)]
xfs: add a zoned growfs test

Zoned file systems require zone aligned RT volume sizes.  Because of
that xfs/596 won't work as-is.  Copy it and test two zone capacity
aligned values.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agoxfs: add a test for zoned block accounting after remount
Christoph Hellwig [Thu, 8 May 2025 05:34:32 +0000 (07:34 +0200)]
xfs: add a test for zoned block accounting after remount

Test for a problem with an earlier version of the zoned XFS mount code
where freeded blocks in an open zone weren't properly accounted for.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agofstests: add a new rw_hint helper
Christoph Hellwig [Thu, 8 May 2025 05:34:31 +0000 (07:34 +0200)]
fstests: add a new rw_hint helper

Add a tool to set the life time hint via fcntl.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
4 months agocommon: generalize _filter_agno
Christoph Hellwig [Thu, 8 May 2025 05:34:30 +0000 (07:34 +0200)]
common: generalize _filter_agno

Rename and move to common/xfs so that it can be reused for rgnos in new
zoned tests.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>