Commit Graph

4567 Commits

Author SHA1 Message Date
Darrick J. Wong 47361c6542 common/rc: refactor _require_{ext2,tmpfs} helpers
Combine these two helpers into a single generic function so that we can
use it in the next patch to test a regression when running overlayfs
atop xfs.

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-03-28 23:27:32 +08:00
Darrick J. Wong 4acd3ddd8e xfs: test rtalloc alignment and math errors
Add a couple of regression tests for "xfs: make sure the rt allocator
doesn't run off the end" and "xfs: ensure that fpunch, fcollapse, and
finsert operations are aligned to rt extent size".

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-28 23:26:11 +08:00
André Almeida 1fc1737959 generic/556: Fix rename test
Casefold rename test should check if renaming a file to an equivalent
name fails as expect (e.g. renaming from "file.txt" to "FILE.TXT") and
`mv` correctly identifies that those names refers to the same file.
Currently, the test doesn't do what is expected given that it doesn't
have the file to be renamed, and `mv` returns "No such file or
directory". Fix that by creating test files and checking the correct
output.

Fixes: 12b7dddbc2 ("generic: Add tests for filename casefolding feature")
Signed-off-by: André Almeida <andrealmeid@collabora.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-28 23:19:04 +08:00
André Almeida 4243ee6a3d common: Escape SCRATCH_DEV variable
Escape SCRATCH_DEV variable so it prints its name, instead of printing
the value. If the value is "", the error message will not be very
informative.

Signed-off-by: André Almeida <andrealmeid@collabora.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-28 23:18:57 +08:00
Darrick J. Wong 7be083b142 common/populate: change how we describe cached populated images
The device name of a secondary storage device isn't all that important,
but the size is.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-28 23:16:41 +08:00
Darrick J. Wong 77166a85ef common/populate: create fifos when pre-populating filesystems
Create fifos when populating the scratch filesystem for completeness.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-28 23:16:08 +08:00
Darrick J. Wong 404d9f2b50 populate: create block devices when pre-populating filesystems
I just noticed that the fs population helper creates a chardev file
"S_IFBLK" on the scratch filesystem.  This seems bogus (particularly
since we actually also create a chardev named S_IFCHR) so fix up the
mknod calls.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-28 23:15:39 +08:00
Darrick J. Wong d65111a674 xfs/122: embiggen struct xfs_agi size for inobtcount feature
Make the expected AGI size larger for the inobtcount feature.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-28 22:20:22 +08:00
Darrick J. Wong 15bb2505e5 xfs/{010,030}: update repair output to deal with inobtcount feature
Update both of these tests to filter out the new error messages from
repair when the inode btree counter feature is enabled.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-28 22:20:18 +08:00
Pavel Reichl 973865af3c xfs: no excessive warnings about dprecated mount options on remount
Verify that warnings about deprecated mount options are properly
printed.

Verify that no excessive warnings are printed during remounts.

Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-03-28 22:17:02 +08:00
Chandan Babu R c68a8f5992 xfs: Stress test with bmap_alloc_minlen_extent error tag enabled
This commit adds a stress test that executes fsstress with
bmap_alloc_minlen_extent error tag enabled.

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:52:50 +08:00
Chandan Babu R 200ee9e93b xfs: Check for extent overflow when swapping extents
This test verifies that XFS does not cause inode fork's extent count to
overflow when swapping forks across two files.

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:51:59 +08:00
Chandan Babu R 3ab311f592 xfs: Check for extent overflow when remapping an extent
This test verifies that XFS does not cause inode fork's extent count to
overflow when remapping extents from one file's inode fork to another.

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:51:17 +08:00
Chandan Babu R 7425ee44da xfs: Check for extent overflow when moving extent from cow to data fork
This test verifies that XFS does not cause inode fork's extent count to
overflow when writing to/funshare-ing a shared extent.

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:50:41 +08:00
Chandan Babu R 490a8d56fb xfs: Check for extent overflow when writing to unwritten extent
This test verifies that XFS does not cause inode fork's extent count to
overflow when writing to an unwritten extent.

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:50:00 +08:00
Chandan Babu R b721a21743 xfs: Check for extent overflow when adding/removing dir entries
This test verifies that XFS does not cause inode fork's extent count to
overflow when adding/removing directory entries.

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:49:12 +08:00
Chandan Babu R 224a674587 xfs: Check for extent overflow when adding/removing xattrs
This test verifies that XFS does not cause inode fork's extent count to
overflow when adding/removing xattrs.

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:48:17 +08:00
Chandan Babu R 9ffcdd4c78 xfs: Check for extent overflow when punching a hole
This test verifies that XFS does not cause inode fork's extent count to
overflow when punching out an extent.

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:47:14 +08:00
Chandan Babu R d9d2de11ef xfs: Check for extent overflow when growing realtime bitmap/summary inodes
Verify that XFS does not cause realtime bitmap/summary inode fork's
extent count to overflow when growing the realtime volume associated
with a filesystem.

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:45:56 +08:00
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
Chandan Babu R c25df583e3 common/xfs: Add helper to obtain fsxattr field value
This commit adds a helper function to obtain the value of a particular field
of an inode's fsxattr fields.

Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
2021-03-21 21:41:47 +08:00
Chandan Babu R b0b379e77d common/xfs: Add a helper to get an inode fork's extent count
This commit adds the helper _scratch_get_iext_count() which returns an
inode fork's extent count.

Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
2021-03-21 21:34:50 +08:00
Chandan Babu R 1066be0dd6 _check_xfs_filesystem: sync fs before running scrub
Tests can create a scenario in which a call to syncfs() issued at the end of
the execution of the test script would return an error code. xfs_scrub
internally calls syncfs() before starting the actual online consistency check
operation. Since this call to syncfs() fails, xfs_scrub ends up returning
without performing consistency checks on the test filesystem. This can mask a
possible on-disk data structure corruption.

To fix the above stated problem, this commit invokes syncfs() prior to
executing xfs_scrub.

Suggested-by: Darrick J. Wong <djwong@kernel.org>
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:34:26 +08:00
Darrick J. Wong 9fb30a9500 common: capture qcow2 dumps of corrupt ext* filesystems
Create a new helper to use e2image to capture a qcow2 image of an ext*
filesystem and make _check_generic_filesystem use it to dump corrupt ext
images.  Refactor the single user of e2image to use the helper.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-03-21 21:31:38 +08:00
Darrick J. Wong b7860b30ce populate: support compressing metadumps
If the test runner passed in a DUMP_COMPRESSOR program, make it so that
the metadumps we generate are also compressed.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-03-21 21:31:35 +08:00