Commit Graph

4717 Commits

Author SHA1 Message Date
Darrick J. Wong 75c9b616fc shared/298: fix random deletion when filenames contain spaces
Correct the deletion loop in this test to work properly when there are
files in $here that have spaces in their name.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-18 22:27:11 +08:00
Darrick J. Wong 0de642617f xfs/172: disable test when file writes don't use delayed allocation
This test tries to exploit an interaction between delayed allocation and
writeback on full filesystems to see if it can trip up the filestreams
allocator.  The behaviors do not present if the filesystem allocates
space at write time, so disable it under these scenarios.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-18 22:26:44 +08:00
Matthew Wilcox 6aa7a5c714 src/seek_sanity_test: test seeks from LLONG_MIN
We don't currently test seeking from LLONG_MIN, which apparently can
produce an UBSAN warning, although I've been unable to reproduce
that.  In any case, it's a good corner case to test and
straightforward to add.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-18 22:06:40 +08:00
Dave Chinner 391b0b0908 generic/459: catch mount failure
Because if we don't, we freeze the root filesystem instead of
$SCRATCH_MNT and it all goes downhill from there.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-18 21:52:45 +08:00
Pavel Reichl 6fc0bd027a generic/{453,454}: Don't run for FSs restricting names
Running generic/{453,454} tests is probably only useful for filesystems
that allow unrestricted byte streams for names.

Signed-off-by: Pavel Reichl <preichl@redhat.com>
Suggested-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-18 21:51:59 +08:00
Naohiro Aota 99baa0ade4 fstests: install btrfs_crc32c_forged_name.py
btrfs/154 uses btrfs_crc32c_forged_name.py but the file is not
installed in the PKG_LIB_DIR. Also consolidate install target files
into EXTRA_EXECS.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-18 20:59:13 +08:00
Filipe Manana 8ae8a045b5 btrfs: test fsync after increasing file size with truncate
Test that if we explicitly fsync a file that was previously renamed and
its size was increased through a truncate operation, after a power failure
the file has the size set by the truncate operation. Also, in between the
truncation and the fsync, there was a rename of another file in the same
directory and that file was also fsynced before we fsynced the file that
was truncated.

This currently fails on a 5.13 kernel and on Linus' master branch. It is
fixed by a patch with the following subject:

  "btrfs: fix unpersisted i_size on fsync after expanding truncate"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-18 14:43:02 +08:00
Anand Jain 2226eece67 btrfs: test case to fstrim on a degraded filesystem
Create a degraded btrfs filesystem and run fstrim on it.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-18 14:39:08 +08:00
Theodore Ts'o 3ff9e88c09 ext4/048: skip test of filename wipe if journal checkpoint is not supported
ext4/048 will fail when running on older kernels that don't support
the filename wipe feature.  The journal checkpoint ioctl is a related
feature, and landed just a little bit after filename wipe feature, so
use support for the journal checkpoint ioctl as a proxy for support
for the filename wipe feature.

Without this change, this test will fail when tesing 5.10, 5.4, and
other LTS kernels.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Leah Rumancik <leah.rumancik@gmail.com>
Tested-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Leah Rumancik <leah.rumancik@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-18 14:37:47 +08:00
Yang Xu 623b4ea408 overlay/Makefile: Use the unified name rules
Since xfs/ext4 uses XFS_DIR/EXT4_DIR in Makefile(also for other filesystems),
I think we don't have any reason not to use OVERLAY_DIR in here.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-04 20:51:59 +08:00
Yang Xu 23e3bf7e28 Makefile: fix bug when running make install under tests/* directory
The TESTS_DIR value is defined in TOPDIR makefile, it is empty here.
So running make install on ext4 directory will get the following info:

../../install-sh -o root -g root -m 755 -d /var/lib/xfstests//ext4

We can see they aren't installed under /var/lib/xfstests/tests/ext4 directory.
Fix this by moving TESTS_DIR definition to include/builddefs.in file.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-04 19:05:53 +08:00
Darrick J. Wong c9419e671d tools: make convert-group ignore converted test files
Teach the tool that rewrites tests files to use _begin_fstest group
tagging to ignore tests that have already been treated.  This will make
it easier for people to rebase their dev branches.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-04 19:03:50 +08:00
Jeff Layton 80b8fe47d0 generic: ensure that page is properly filled before write
We had a broken optimization in cephfs and netfs lib that could
cause part of a page to be improperly zeroed-out when writing to an
offset that was beyond the EOF but in an existing page.

Add a simple test that would have caught this.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-04 19:02:25 +08:00
Anju T Sudhakar 3be0233fbb xfs/504: Add scratch_mount before checking for xfs_scrub unicode support
We may not detect the error `Inappropriate ioctl for device`, while running
`$XFS_IO_PROG -c "scrub probe" "$mountpoint"`, if scratch device is not
mounted before invoking _check_xfs_scrub_does_unicode(). So do
_scratch_mount before checking for xfs_scrub support.

Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-04 18:09:21 +08:00
Theodore Ts'o a9e50808a8 check: exit with exit code 1 after printing the usage message
If check is passed an invalid command line option, exit with a
non-zero exit code so that a script calling check can detect the
failure.  The check script already performs an "exit 1" if a valid
option has an invalid argument, so this is consistent with existing
practice.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-04 18:06:46 +08:00
Sun Ke c360cd10a1 generic/260: f2fs is also special
It fail on f2fs:

 [+] Default length with start set (should succeed)
 [+] Length beyond the end of fs (should succeed)
 [+] Length beyond the end of fs with start set (should succeed)
+After the full fs discard 0 bytes were discarded however the file system is 12882804736 bytes long.
+It seems that fs logic handling len argument overflows

The root cause is f2fs can tag a special flag TRIMMED_FLAG to
indicate the whole filesystem is trimmed, so after mkfs/fstrim(),
following fstrim() won't trim any block.

Suggested-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Sun Ke <sunke32@huawei.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-04 17:51:13 +08:00
Sun Ke 9e31513f5f generic/103: special left calculation for f2fs
It failed on f2fs:
      QA output created by 103
     +fallocate: No space left on device
      Silence is golden.
     ...

f2fs uses index(radix) tree as mapping metadata, its space overhead
is about one thousandth of the data.

Suggested-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Sun Ke <sunke32@huawei.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-04 17:51:08 +08:00
Sun Ke 7f17fee84a generic/042: make a bigger img for f2fs
f2fs-utils 1.9.0 needs at least 38 MB space for f2fs image. However,
f2fs-utils 1.14.0 needs at least 52 MB. Not sure if it will change
again.  So, just set it to 128M.

Suggested-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Sun Ke <sunke32@huawei.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-04 17:50:58 +08:00
Dave Chinner 35ff42b1dc generic/019: fix test cleanup
This never worked properly and the failure was exposed by the recent
rework of the fstest setup infrastructure.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-07-04 17:44:35 +08:00
Darrick J. Wong 7303011439 misc: update documentation to reflect auto-generated group files
Update the documentation to outline the new requirements for test files
so that we can generate group files during build.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-06-27 22:50:32 +08:00
Darrick J. Wong 4d695817c8 fstests: remove test group management code
Remove all the code that manages group files, since we now generate
them at build time.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-06-27 22:50:27 +08:00
Darrick J. Wong 112f075534 fstests: remove group files
From: Darrick J. Wong <djwong@kernel.org>

Now that we autogenerate group files, get rid of them in the source
tree.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-06-27 22:50:22 +08:00
Darrick J. Wong b5c1a98c7c check: use generated group files
Convert the ./check script to use the automatically generated group list
membership files, as the transition is now complete.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-06-27 22:50:19 +08:00
Darrick J. Wong 810df5225b fstests: adapt the new test script to our new group tagging scheme
Now that we autogenerate group files, adapt the new test creation script
to use autogenerated group files and to set the group data in the new
test.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-06-27 22:50:15 +08:00
Darrick J. Wong 5a5f95007a fstests: convert nextid to use automatic group generation
Convert the nextid script to use the automatic group file generation to
figure out the next available test id.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-06-27 22:50:10 +08:00