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>
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>
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>
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>
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>
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>
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>
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:
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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:
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Darrick J. Wong [Wed, 7 May 2025 21:54:23 +0000 (14:54 -0700)]
xfs/349: don't run on kernels that don't support scrub
Don't run this scrub test if the kernel doesn't support scrub.
Fixes: f5f0c11a67a8f5 ("xfs: fuzz every field of every structure") Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Zorro Lang <zlang@kernel.org>
Darrick J. Wong [Wed, 7 May 2025 21:54:07 +0000 (14:54 -0700)]
fsstress: fix attr_set naming
Back in 2020 I converted attr_set to lsetxattr, but neglected to notice
that the attr name now has to have the prefix "user." which attr_set
used to append for us. Unfortunately nobody runs fsstress in verbose
mode so I didn't notice until now, and even then only because fuse2fs
stupidly accepts any name, even if that corrupts the filesystem.
Found by running generic/642 on fuse2fs.
Cc: fstests@vger.kernel.org # v2022.05.01 Fixes: 808f39a416c962 ("fsstress: stop using attr_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>
fstests/MAINTAINERS: update ocfs2 mailing list address
Bring the ocfs2 mailing list address up to date, following the upstream
change in kernel commit a57b4b7f0557 ("MAINTAINERS: update ocfs2-devel
mailing list address").
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>
common: Move exit related functions to a common/exit
Introduce a new file common/exit that will contain all the exit
related functions. This will remove the dependencies these functions
have on other non-related helper files and they can be indepedently
sourced. This was suggested by Dave Chinner[1].
While moving the exit related functions, remove _die() and die_now()
and replace die_now with _fatal(). It is of no use to keep the
unnecessary wrappers.
Suggested-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
fstests: btrfs/253: fix false alert due to _set_fs_sysfs_attr changes
[FALSE FAILURE]
Test btrfs/253 now fails like the following:
btrfs/253 2s ... - output mismatch (see ~/xfstests/results//btrfs/253.out.bad)
--- tests/btrfs/253.out 2022-05-11 11:25:30.753333331 +0930
+++ ~/xfstests/results//btrfs/253.out.bad 2025-04-20 17:28:39.139180394 +0930
@@ -5,6 +5,7 @@
Calculate request size so last memory allocation cannot be completely fullfilled.
Third allocation.
Force allocation of system block type must fail.
+./common/rc: line 5213: echo: write error: No space left on device
Verify first allocation.
Verify second allocation.
Verify third allocation.
...
(Run 'diff -u ~/xfstests/tests/btrfs/253.out ~/xfstests/results//btrfs/253.out.bad' to see the entire diff)
[CAUSE]
Since commit 0a9011ae6a36 ("fstests: common/rc: set_fs_sysfs_attr:
redirect errors to stdout") the function _set_fs_sysfs_attr() always
output everything into stdout, thus the stderr redirection makes no
sense anymore.
And the expected failure will cause output difference and fail the test.
[FIX]
Use the helper _set_sysfs_policy_must_fail() instead, which will handle
the failure.
And update the golden output to include the expected ENOSPC error
message.
Chao Yu [Thu, 27 Mar 2025 05:50:51 +0000 (13:50 +0800)]
f2fs/011: test to check out-of-space issue
This is a regression testcase to check whether we will handle
out-of-space case correctly during fallocate() on pinned file
once we disable checkpoint.
Testcase:
1. mount f2fs w/ checkpoint=disable option
2. create fragmented file data
3. set flag w/ pinned flag
4. fallocate space for pinned file, expects panic due to running
out of space.
We should apply both commit ("f2fs: fix to avoid panic once
fallocation fails for pinfile") and commit ("f2fs: fix to avoid
running out of free segments") to avoid system panic.
Note that w/ these two commit, we fixed such issue in both
convential and zoned block device.
Cc: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Chao Yu <chao@kernel.org> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
This test uses su to run fsstress as $qa_user. Because the shell calling
fsstress is run as $qa_user it might not be able to access the xfstests
or parent directory which might only be accessible to the user xfstests
is run as (e.g. root). Switch back to calling fsstress using a relative
path, partially reverting the effects of commit c475ff6ff6d7
("common/config: add $here to FSSTRESS_PROG").
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
This test uses su to run fsx as $qa_user. Because the shell calling
fsx is run as $qa_user it might not be able to access the xfstests or
parent directory which might only be accessible to the user xfstests
is run as (e.g. root). Switch back to calling fsx using a relative
path, partially reverting commit 1c67e8b191fe
("config: add FSX_PROG variable").
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
Anna Schumaker [Fri, 25 Apr 2025 15:24:52 +0000 (11:24 -0400)]
generic/033: Don't call 'fzero' with the KEEP_SIZE flag
None of the fzero calls in this test end up writing past the end of the
file, so this flag is unnecessary and can cause the test to fail on
filesystems that don't implement FALLOC_FL_KEEP_SIZE.
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Anand Jain [Fri, 31 Jan 2025 07:14:43 +0000 (15:14 +0800)]
fstests: common/sysfs: add new file sysfs and helpers
Introduce `verify_sysfs_syntax()` and `_require_fs_sysfs_attr_policy()`
to verify whether a sysfs attribute rejects invalid input arguments
during writes.
Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Anand Jain [Wed, 29 Jan 2025 07:54:50 +0000 (15:54 +0800)]
fstests: common/rc: set_fs_sysfs_attr: redirect errors to stdout
Redirect sysfs write errors to stdout as a preparatory patch to enable
testing of expected sysfs write failures. Also, log the executed
sysfs write command and its failure if any to seqres.full for better
debugging and traceability.
Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Replace exit <return-val> with _exit <return-val> which
is introduced in the previous patch.
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
common/config: Introduce _exit wrapper around exit command
We should always set the value of status correctly when we are exiting.
Else, "$?" might not give us the correct value.
If we see the following trap
handler registration in the check script:
if $OPTIONS_HAVE_SECTIONS; then
trap "_kill_seq; _summary; exit \$status" 0 1 2 3 15
else
trap "_kill_seq; _wrapup; exit \$status" 0 1 2 3 15
fi
So, "exit 1" will exit the check script without setting the correct
return value. I ran with the following local.config file:
This caused the init_rc() to catch the case of invalid _test_mount
options. Although the check script correctly failed during the execution
of the "xfs_4k_invalid" section, the return value was 0, i.e "echo $?"
returned 0. This is because init_rc exits with "exit 1" without
correctly setting the value of "status". IMO, the correct behavior
should have been that "$?" should have been non-zero.
The next patch will replace exit with _exit.
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
check,common{rc,preamble}: Decouple init_rc() call from sourcing common/rc
Silently executing scripts during sourcing common/rc isn't good practice
and also causes unnecessary script execution. Decouple init_rc() call
and call init_rc() explicitly where required.
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
init_rc already does a _test_mount. Hence removing the additional
_test_mount call when OLD_TEST_FS_MOUNT_OPTS != TEST_FS_MOUNT_OPTS.
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
generic/367: Remove redundant sourcing of common/config
common/config will be source by _begin_fstest
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> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
generic/749: Remove redundant sourcing of common/rc
common/rc is already sourced before the test starts running
in _begin_fstest() preamble.
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Darrick J. Wong [Wed, 9 Apr 2025 15:16:12 +0000 (08:16 -0700)]
generic/275: fix on 32k fsblock filesystems
This test fails on 32k-fsblock filesystems:
dd: failed to open '/opt/tmp3': No space left on device
dd: failed to open '/opt/tmp4': No space left on device
Pre rm space:
Filesystem Type 1024-blocks Used Available Capacity Mounted on
/dev/sda4 xfs 20316162030624 992 100% /opt
Post rm space:
Filesystem Type 1024-blocks Used Available Capacity Mounted on
/dev/sda4 xfs 20316162030368 1248 100% /opt
could not sufficiently fill filesystem
On a 32k-fsblock filesystem, creating tmp3 and tmp4 requires more than
1MB for the transaction allocation, which is why this test fails to fill
the filesystem. To fix this, touch the four tmp files before trying to
use up all the free space. The fix in ef25a29fa49a50 was incomplete.
Cc: fstests@vger.kernel.org # v2022.07.24 Fixes: ef25a29fa49a50 ("generic/275: fix premature enospc errors when fs block size is large") Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Zorro Lang <zlang@kernel.org>
Darrick J. Wong [Wed, 9 Apr 2025 15:15:34 +0000 (08:15 -0700)]
xfs/792: skip test if rextsize isn't congruent with operation length
This test writes 64k chunks and encodes the file content hash in the
golden output. Don't run it if the file allocation unit isn't congruent
with 64k. Fixes extsize=28k configurations.
Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Zorro Lang <zlang@kernel.org>
Darrick J. Wong [Tue, 8 Apr 2025 18:17:32 +0000 (11:17 -0700)]
xfs/801: provide missing sysfs-dump function
This test uses sysfs-dump to capture THP diagnostic information to
$seqres.full. Unfortunately, that's not a standard program (it's one of
my many tools) and I forgot to paste the script into the test. Hence
it's been broken since merge for everyone else. Fix it.
Cc: fstests@vger.kernel.org # v2024.08.11 Fixes: 518896a7b483c0 ("xfs: test online repair when xfiles consists of THPs") Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Zorro Lang <zlang@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Zorro Lang <zlang@kernel.org>