Commit Graph

160 Commits

Author SHA1 Message Date
Darrick J. Wong 1bdf7c3508 xfs: test xfs_copy and xfs_mdrestore on the populate images
Make sure that copy, metadump, and mdrestore work on a filesystem with
all known metadata types.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-03-24 23:16:56 +08:00
Christoph Hellwig 6fd9210bc9 fstests: add a seek group
This groups all tests exercising SEEK_DATA / SEEK_HOLE behavior.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-02-21 09:48:27 +08:00
Christoph Hellwig ca513ad171 xfs/42[01]: remove from the dedup group
No dedup functionality is exercised by these tests.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-02-21 09:48:27 +08:00
Darrick J. Wong e7046479b4 xfs/500: fix reflink support detection and add new groups
Fix some problems detecting reflink support in the test.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-02-21 09:48:27 +08:00
Darrick J. Wong e6703b903a generic: check the behavior of programs opening a lot of O_TMPFILE files
Create a test (+ helper program) that opens as many unlinked files as it
possibly can on the scratch filesystem, then closes all the files at
once to stress-test unlinked file cleanup.  Add an xfs-specific test to
make sure that the fallback code doesn't bitrot.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-02-16 20:46:30 +08:00
Darrick J. Wong c869a6712a xfs: test mkfs extent size hint validation
Make sure mkfs won't format filesystems that fail extent size hint
validation.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-02-16 18:55:18 +08:00
Darrick J. Wong a190cead9e xfs: look for stringified constants in ftrace formats
Look for uninterpretable stringified constants in the ftrace format
description for xfs tracepoints.

[Eryu: add $CC_PROG definition and require it in test, also use
$DEBUGFS_MNT instead of hard coded path]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-12-23 22:30:56 +08:00
Darrick J. Wong a8d2e332b0 xfs: fuzz directories containing single leafn blocks
Test scrub, repair, and metadata verifiers on directories containing
fuzzed single-leafn blocks.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2018-11-04 21:49:50 +08:00
Darrick J. Wong acada47e49 xfs: test repair regression of dir w/ single leafn block
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-11-04 00:58:35 +08:00
Darrick J. Wong 37113e5f4f xfs: test packaged crc32c code
Use the new crc32selftest command in xfs_io to check the correct
operation of the packaged xfsprogs, on the off chance that the packages
were cross compiled on a different machine type (which means the build
time test doesn't hold much water).

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-11-03 23:54:16 +08:00
Darrick J. Wong a62490a118 xfs: test mount time summary counter check and fix
Tests to ensure that the xfs mount code can detect obviously bad fs
summary counters at mount time and fix them.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-10-14 23:08:30 +08:00
Zorro Lang 3a64a884c4 xfs: test inode allocation state missmatch corruption
There's a situation where the directory structure and the inobt
thinks the inode is free, but the inode on disk thinks it is still
in use. XFS should detect it and prevent the kernel from oopsing on
lookup.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-08-05 21:34:47 +08:00
Darrick J. Wong 0804dc1736 xfs: fuzz every field of every structure and test kernel crashes
Fuzz every field of every structure and then try to write the
filesystem, to see how many of these writes can crash the kernel.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-07-08 21:16:35 +08:00
Zorro Lang c6ded48a31 xfs: test bad character in xfs_db field list selector string
Bad characters likes tailing asterisk, slash or quote in xfs_db
field string can trigger a xfs_db crash. This bug has been fixed by
xfsprogs commit 945e47e2fcc5 ("xfs_db: fix crash when field list
selector string has trailing slash").

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-07-01 20:35:27 +08:00
Marco Benatto 6a98def59c xfs: Test root inode parent pointer repairing
Recently we found out xfs_repair were not repairing root inode
parent pointer when root inode is on short-form and parent points to
an invalid inode number (refer to: "xfs_repair: Fix root inode's
parent when it's bogus for sf directory" on xfs-devel list).

This test checks if xfs_repair successfully repair the filesystem in
the scenario mentioned before.

Signed-off-by: Marco Benatto <mbenatto@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-07-01 20:35:27 +08:00
Darrick J. Wong 494b07e340 xfs: regression test for rmapbt fdblocks accounting problems
In "xfs: fix fdblocks accounting w/ RMAPBT per-AG reservation", we fixed
the per-ag reservation code so that we always decrease fdblocks by the
reserved size because rmapbt blocks are counted as free space.

The primary symptom of this bug is that if the rmapbt has expanded since
mount time, the disk block counters reported via statfs will change
across a remount. Therefore, we exercise this as a regression test.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-07-01 20:35:27 +08:00
Darrick J. Wong 8585efc1e6 xfs: make sure pretty printed geometry output matches
Make sure that all of our commands that can print geometry
information all print the /same/ information.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-06-08 14:12:25 +08:00
Xiao Yang f7f040063c xfs: Regression test for vulnerable directory integrity check
If a malicious XFS contains a block+ format directory wherein the
directory inode's core.mode is corrupted, and there are
subdirectories of the corrupted directory, an attempt to traverse up
the directory tree by running xfs_scrub will crash the kernel in
__xfs_dir3_data_check.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-06-05 08:44:13 +08:00
Theodore Ts'o 72ec5e2ff7 fstests: update the punch, collapse, insert, and zero groups
Update the group files to annotate those tests which have a
_require_xfs_io_command for punch, collapse, insert, and zero.  This
makes it easier to exclude tests that use one of these fallocate
commands.  Or if you want to specifically test for those fallocate
commands you can do this.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-05-31 23:24:37 +08:00
Omar Sandoval 39aca573e4 fstests: create swap group
I'm going to add a bunch of tests for swap files, so create a group
for them and add the existing tests.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-05-23 09:58:58 +08:00
Dave Chinner 5fc65da0a6 xfs: test mount vs superblock shrinker races
Test case for superblock shrinkers running while the filesystem is
being set up and/or torn down and tripping over inconsistent state.

Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-05-16 10:03:03 +08:00
Darrick J. Wong 331edc6af6 xfs: checkbashisms in all script files
Find all the /bin/sh scripts in xfsprogs and check for bashisms.

Cc: sandeen@sandeen.net
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-05-11 20:55:35 +08:00
Dave Chinner 272ddcdd19 xfs: test inobt/on disk free state mismatches
Fuzzing has recently uncovered a couple of conditions where we don't
detect corruptions that reallocate already allocated inodes. This
test exercises those cases, and checks that we shut down the
filesystem appropriately when such a corruption occurs.

Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-05-11 18:40:04 +08:00
Dave Chinner f3851ad630 fstests: many dangerous+auto tests are not dangerous anymore
There are a bunch of tests that are run by the auto group that are
marked dangerous. This was done because the test exercised a crash
or other fatal error that has since been fixed. Remove the dangerous
tag from the auto tests that pass on a 4.17-rc3 kernel as they are
not dangerous anymore.

Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-05-11 09:36:26 +08:00
Amir Goldstein 00e3549c65 xfs/132: remove duplicate test
Test description says: "This is the same test as generic/156 except
that we also check the inode reflink flag.", only since commit
f1c3fee ("xfs: remove NOCOW_FL testing from test") it is almost
exactly the same test as generic/156.
almost - because since xfs/132 diverged from generic/156 the change
911efb0 ("reflink: change to relative margins") is only applied to
the original test.

Anyway, there doesn't seem to be a reason to keep this duplicated
test anymore, so remove it.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-05-06 01:18:26 +08:00