Commit Graph

474 Commits

Author SHA1 Message Date
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
Chandan Rajendra b0c8d2f735 xfs/140: work with 1k block size
Commit 7a7641063a (xfs/140: work with 64k
block size) created a test filesystem with AG size set to (8192 * block
size). When working with a 1k block sized XFS filesystem, this tries to
set the AG size to 8MiB which is less than the minimum AG size of
16MiB. Hence creation of the filesystem had actually failed.

This commit fixes the issue by resetting AG size to 16MiB if (8192 *
block size) results in a value less than 16MiB. Later the test file size
and the test file block count are then appropriately calculated.

Reported-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-10-21 17:29:40 +08:00
Chandan Rajendra 9d8f4e1c86 xfs/139: work with 1k block size
Commit 0e2b99951f (xfs/139: work with 64k
block size) created a test filesystem with AG size set to (8192 * block
size). When working with a 1k block sized XFS filesystem, this tries to
set the AG size to 8MiB which is less than the minimum AG size of
16MiB. Hence creation of the filesystem had actually failed.

This commit fixes the issue by setting AG size to be (16384 * block
size).

Reported-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-10-21 17:29:32 +08:00
Darrick J. Wong 9200725300 xfs/288: shut up verifier error
Ignore the verifier errors when we fuzz hdr.count to zero.

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:11:18 +08:00
Darrick J. Wong 8cd8fa12e1 xfs/270: use _scratch_xfs_set_metadata_field to fuzz rocompat bits
Use the helper to set the metadata field so that we can bypass write
verifier checks.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-10-14 23:10:20 +08:00
Darrick J. Wong ed9251da1e xfs/189: skip 'barrier' mount option test on newer kernels
Starting in Linux 4.19 the 'barrier' and 'nobarrier' mount options were
removed.  If mount complains about a bad option when we remount with
'barrier', just skip 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>
2018-10-14 23:09:32 +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
Eric Sandeen 1895cf6b65 xfs/122: add struct xfs_unmount_log_format
struct xfs_unmount_log_format used to be anonymous and gained a name
in 4.19, so add that to the list of expected structures in xfs/122.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-10-06 17:38:27 +08:00
Chandan Rajendra 8039c7cd3c xfs/325: Inject free_extent error after CoW operation
On a 64k blocksized filesystem, when the test CoWs the file2's offset
range [10 * 64k, 19 * 64k], the call to xfs_bmapi_reserve_delalloc()
allocates 32 64k blocks. This is because XFS_DEFAULT_COWEXTSZ_HINT has
the value of 32 and xfs_get_cowextsz_hint() uses this to compute the
extent alignment. This leads to xfs_bmapi_reserve_delalloc() to reserve
space corresponding to the file range [0, 32 * 64k] in the inode's
cow fork area. On completion of write I/O corresponding to file2's range
[10 * 64k, 19 * 64k], xfs_end_io() moves 10 out of the originally
allocated 32 64k blocks to the data fork area. The remaining 22 64k
blocks linger on in cow fork area of the inode.

Later, when servicing the exit() syscall for the xfs_io process,
xfs_free_eofblocks() ends up invoking xfs_reflink_cancel_cow_blocks()
since i_delayed_blks has the value 22. xfs_reflink_cancel_cow_blocks()
indirectly invokes __xfs_free_extent() which returns EIO since
XFS_ERRTAG_FREE_EXTENT has been set. This leads to the filesystem to be
shutdown. The "rm" command invoked later ends up returning an
error and hence the test fails. The test actually requires that the
filesystem gets shutdown when executing the "rm" command.

To fix the problem, this commit injects the free_extent error after we
CoW file2's [10 * 64k, 19 * 64k] range.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-30 13:57:50 +08:00
Chandan Rajendra dac07d0816 xfs/299: work with 64k block size
This commit changes the test to calculate quota limits based on the
block size of the underlying filesystem. Also, the sizes of the test
files are now made to be a multiple of the filesystem block size.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-30 13:57:50 +08:00
Chandan Rajendra 8758c0065f xfs/299: Fix "Push past soft inode limit" case
The test sets an inode soft limit of four but only three files are
created. This commit creates two more files in order to really push past
the soft inode limit.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-30 13:57:50 +08:00
Chandan Rajendra 42389505f9 xfs/190: work with 64k block size
This commit describes "file hole" ranges in multiples of block sizes
rather than using constants.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-30 13:57:50 +08:00
Chandan Rajendra 7a7641063a xfs/140: work with 64k block size
For 64k block size, the agsize provided in the test causes mkfs.xfs to
fail due to insufficient log space. Hence this commit computes agsize
based on block size of the filesystem.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-30 13:57:50 +08:00
Chandan Rajendra 0e2b99951f xfs/139: work with 64k block size
For 64k block size, the agsize provided in the test causes mkfs.xfs to
fail due to insufficient log space. Hence this commit computes agsize
based on block size of the filesystem.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-30 13:57:50 +08:00
Chandan Rajendra d06c2700b2 xfs/127: work with 64k block size
With reflink feature enabled, we require atleast 500MiB of
disk space to create a filesystem with 64k block size. Hence this commit
sets the size of the scratch filesystem to 512MiB.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-30 13:57:50 +08:00
Chandan Rajendra 204974ec07 xfs/074: work with 64k block size
This commit makes file and extent size calculations to be a function of
the filesystem's block size. It also adds a brief description of the
bug that is being tested.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-30 13:57:50 +08:00
Chandan Rajendra 371cf4cf16 xfs/050: work with 64k block size
This commit changes the test to calculate quota limits based on the
block size of the underlying filesystem. Also, the sizes of the test
files are now made to be a multiple of the filesystem block size.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-30 13:57:50 +08:00
Chandan Rajendra 05802a3a8a xfs/050: Fix "Push past soft inode limit" case
The test sets an inode soft limit of four but only three files are
created. This commit creates two more files in order to really push past
the soft inode limit.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-30 13:57:50 +08:00
Chandan Rajendra a97909b3f9 xfs/009: work with 64k block size
xfs_alloc_file_space() rounds up allocation requests by the filesystem
block size. Hence this commit changes the test to work with block size
units rather than with a multiple of 4096 bytes.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-30 13:57:50 +08:00
Eric Sandeen 9437a03432 xfs/270: allow corrupted xfs_db write
Upcoming verifiers treat the unknown ro_compat flag written via xfs_db
as corruption, so use the -d flag to allow it, and filter our the
resulting informational message.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-28 20:16:05 +08:00
Anand Jain 3c48a2ca20 fstests: fix _test_generic_punch() to fit 64k extent
14 test cases use _test_generic_punch(), and they work well as long
as the ext4/xfs blocksize or btrfs sectorsize is below 4K.

In the system with 64K pagesize, as the blocksize can be upto 64K or the
sectorsize can be 64K so 13/14 test cases fail, because the
test-file-size (20k) and thus the extent boundary offsets aren't
big enough to fit the larger than 4k extent size.

Commit 2f194e4e82 (generic/009: don't run
for btrfs if PAGE_SIZE > 4096) tried to address this by calling the
not_run in generic/009.

And in the function _test_generic_punch() we use multiple=4 to address
the similar problem but its limited to the subcommand fcollapse.

Now to run these test cases successfully on systems with pagesize 64k,
this patch propose to increase the default multiple=1 to multiple=16.
With this we increase the test file size from 20k to 320k and thus it
encapsulates maximum extent size of 64k here. And we can drop the
multiple=4 which is just being done similar for the cases of fcollapse
subcommand only. And it appears to me there is no harm in increasing
the file size and offsets in general for all commands instead of just
fcollapse command.

This change is tested on ext4, xfs and btrfs on system with pagesize
4K and 64K.

With this patch, these 14 test cases runs fine on system with 64K
pagesize as well as pagesize 4K. However we may hit the same
limitation at some point when we want to validate the FSs with
pagesizes -gt 64K. And this patch does not address that part as of
now.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Tested-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-09-23 22:26:56 +08:00
Zorro Lang 794f4594fb fstests: filter redundant output by getfattr
When getfattr dumps values of all extended attributes (-d option),
it doesn't print empty extended attributes. e.g: user.name. But from
attr-2.4.48 this behavior is changed,  new getfattr prints
user.name="".

The {=""} will break the golden image, so filter the redundant =""
at the end if it has.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-08-26 20:55:28 +08:00
Xiao Yang 84fdfc5d8a fstests: Fix buffer alignment of aiocp
In generic/252, aiocp with DIRECT will fail and return EINVAL on
4096 sector size block device, because the default 512 alignment
defined in aiocp is not aligned with 4096.

Please see the following error:
----------------------------------------------------------
read missing bytes expect 8388608 got -22
----------------------------------------------------------

We use '-a' option to specify a proper alignment size in all tests
that call aiocp with DIRECT.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-08-19 20:13:11 +08:00