Commit Graph

192 Commits

Author SHA1 Message Date
Chandan Babu R 9f8584434b xfs: Check for extent overflow when trivally adding a new extent
This test verifies that XFS does not cause inode fork's extent count to
overflow when adding a single extent while there's no possibility of splitting
an existing mapping.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
2021-03-21 21:44:40 +08:00
Darrick J. Wong f6ddaf130d xfs: test delalloc quota leak when chprojid fails
This is a regression test for a bug in the XFS implementation of
FSSETXATTR.  When we try to change a file's project id, the quota
reservation code will update the incore quota reservations for delayed
allocation blocks.  Unfortunately, it does this before we finish
validating all the FSSETXATTR parameters, which means that if we decide
to bail out, we also fail to undo the incore changes.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-15 01:51:35 +08:00
Darrick J. Wong 1e3cf5aeb5 xfs: test quota softlimit warning functionality
Make sure that quota softlimits work, which is to say that one can
exceed the softlimit up to warnlimit times before it starts enforcing
that.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-15 00:53:12 +08:00
Darrick J. Wong cef0ac422b xfs: test mkfs min log size calculation w/ rt volumes
In "mkfs: set required parts of the realtime geometry before computing
log geometry" we made sure that mkfs set up enough of the fs geometry to
compute the minimum xfs log size correctly when formatting the
filesystem.  This is the regression test for that issue.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-15 00:34:59 +08:00
Darrick J. Wong 42484d90a0 xfs: test regression in xfs_bmap_validate_extent
This is a regression test to make sure that we can have realtime files
with xattr blocks and not trip the verifiers.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-14 22:57:47 +08:00
Darrick J. Wong 6497ede7ad fstests: remove DMAPI tests
Upstream XFS has never supported DMAPI, so remove the tests for this
feature.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-14 22:24:48 +08:00
Darrick J. Wong 0ea70dceec xfs: test fallocate ops when rt extent size is and isn't a power of 2
Make sure that fallocate works when the rt extent size is and isn't a
power of 2.

[Eryu: require filefrag command, add _require_loop, use xfs_io to do
truncate]

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-14 22:09:42 +08:00
Darrick J. Wong 08a617f21d xfs: test a regression in dquot type checking
This is a regression test for incorrect ondisk dquot type checking that
was introduced in Linux 5.9.  The bug is that we can no longer switch a
V4 filesystem from having group quotas to having project quotas (or vice
versa) without logging corruption errors.  That is a valid use case, so
add a regression test to ensure this can be done.

[Eryu: add _require_check_dmesg and print the 'corruption' dmesg]

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-02-07 23:17:46 +08:00
Darrick J. Wong 3ba859629d xfs: test mkfs.xfs config files
Simple tests of the upcoming mkfs.xfs config file feature.  First we
have some simple tests of properly formatted config files, then
improperly formatted config files, and finally we try to spot
conflicts between config file options and the cli.

[dchinner: updated for new libinih-based implementation.]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-01-24 23:15:13 +08:00
Darrick J. Wong 6df280a684 xfs: test running growfs on the realtime volume
Make sure that we can run growfs to expand the realtime volume without
it blowing up.  This is a regression test for the following patches:

xfs: Set xfs_buf type flag when growing summary/bitmap files
xfs: Set xfs_buf's b_ops member when zeroing bitmap/summary files
xfs: fix realtime bitmap/summary file truncation when growing rt volume
xfs: make xfs_growfs_rt update secondary superblocks
xfs: annotate grabbing the realtime bitmap/summary locks in growfs

Because the xfs maintainer realized that no, we have no tests for this
particular piece of functionality.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-10-11 13:38:14 +08:00
Pavel Reichl bfe532d6e2 xfs: Add test for too-small device with stripe geometry
Verify hat an attempt to create a too-small device with stripe geometry,
is handled gracefully instead of hitting an assert in align_ag_geometry()

Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-09-27 17:36:46 +08:00
Chandan Babu R 01e8749809 xfs: Add realtime group
This commit adds a new group to classify tests that can work with
realtime devices.

Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-09-21 00:00:10 +08:00
Xiao Yang f85344a72f xfs/260: Move and update xfs/260
1) Both ext4 and xfs have supported FS_XFLAG_DAX so move it to generic.
2) Modifying FS_XFLAG_DAX on flies does not take effect immediately so
   make files inherit the DAX state of parent directory.
3) Setting/clearing FS_XFLAG_DAX have no chance to change S_DAX flag if
   mount with dax option so remove the related subtest.
4) Setting/clearing FS_XFLAG_DAX doesn't change S_DAX flag on older xfs
   due to commit 742d84290739 ("xfs: disable per-inode DAX flag") so
   only do test when fs supports new dax=inode option.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-08-10 01:04:19 +08:00
Gao Xiang 7db17edfba xfs: add test for CVE-2020-12655
Add a regression test to see if kernel hangs in order to
look after CVE-2020-12655 and check if the corresponding
fix is applied as well.

Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-07-20 00:47:56 +08:00
Eryu Guan 2efe93a3be fstests: renumber tests after merge
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-05-25 00:07:45 +08:00
Darrick J. Wong 5053ed2ff0 xfs: test sunit/swidth updates
Add one test to make sure that we can update sunit without blowing up
the filesystem.  This is a regression test for 13eaec4b2adf ("xfs: don't
commit sunit/swidth updates to disk if that would cause repair
failures").

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>
2020-05-25 00:06:48 +08:00
Darrick J. Wong 5e76656346 xfs: make sure our default quota warning limits and grace periods survive quotacheck
Make sure that the default quota grace period and maximum warning limits
set by the administrator survive quotacheck.  This is a regression test
for 5885539f0af371 ("xfs: preserve default grace interval during
quotacheck").

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>
2020-05-25 00:06:45 +08:00
Darrick J. Wong 88e954ae9b xfs: race freeze and fsmap for a while to see if we livelock
Run fsfreeze and fsmap against each other in a loop to see if we observe
any livelocks, crashes, or odd slowness from either operation.  This is
a regression test for 27fb5a72f50aa77 ("xfs: prohibit fs freezing when
using empty transactions").

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>
2020-05-25 00:06:40 +08:00
Darrick J. Wong 06fd8dbbfe xfs: test that reflink forces the log if mounted with wsync
A code inspection revealed that reflink does not force the log to disk
even if the filesystem is mounted with wsync.  Add a regression test for
commit 5833112df7e9a ("xfs: reflink should force the log out if mounted
with wsync").

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>
2020-05-25 00:06:17 +08:00
Darrick J. Wong f10e089987 xfs: make sure xfs_db/xfs_quota commands are documented
Make sure all the xfs_db/xfs_quota commands are documented.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-03-08 23:44:44 +08:00
Theodore Ts'o f877833cf7 fstests: add an eio group
This allows us to run all those tests which simulate disk failures
using dmerror.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-02-23 22:03:45 +08:00
Zorro Lang 30612dc06a xfs: xfs mount option sanity test
XFS is changing to suit the new mount API, so add this case to make
sure the changing won't bring in regression issue on xfs mount
option parse phase, and won't change some default behaviors either.

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>
2020-02-17 21:15:13 +08:00
Christoph Hellwig 3fde92b2a3 xfs: add a new test for removing ACLs through the attr interface
Test that removing the SGI_ACL_FILE attr also removes the cached ACL
used for access control checking.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-02-02 20:46:58 +08:00
Eric Sandeen 7b3ddeec67 fstests: verify that xfs_growfs can operate on mounted device node
The ability to use a mounted device node as the primary argument
to xfs_growfs was added back in with:
  7e8275f8 xfs_growfs: allow mounted device node as argument
because it was an undocumented behavior that some userspace depended on.
This test exercises that functionality.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-01-06 17:00:07 +08:00
Darrick J. Wong fcfa7d242f xfs: make sure the kernel and repair tools catch bad names
Make sure we actually catch bad names in 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>
2019-11-04 23:31:57 +08:00