Latest xfsprogs mkfs.xfs prints "Discarding blocks...Done" if the
disk supports the trim. That breaks the golden image, cause
unexpected failure, so filter out it.
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>
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>
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>
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>
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>
Reorder the order in which we tweak AGF fields to avoid falling afoul of
the new AGF sanity checks.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Running xfs/126 sometimes fails due to output mismatch. Due to the
randomized nature of the test, periodically the selected bits are not
relevant to the test, or the selected bits are not flipped. Supply an
offset that is close to the start of the metadata block, so that the
test will reliably corrupt the header.
Suggested-by: Darrick J. Wong <darrick.wong@oracle.com>
Link: https://lore.kernel.org/linux-xfs/20200116160323.GC2149943@magnolia
Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
When I run xfs/191 with upstream xfsprogs, I get the following
errors because mkfs.xfs binary has changed a lot(use loop device
to avoid stripe alignment affect).
-------------------------
pass -n size=2b /dev/loop0
pass -d agsize=8192b /dev/loop0
pass -d agsize=65536s /dev/loop0
pass -d su=0,sw=64 /dev/loop0
pass -d su=4096s,sw=64 /dev/loop0
pass -d su=4096b,sw=64 /dev/loop0
pass -l su=10b /dev/loop0
fail -n log=15 /dev/loop0
fail -r rtdev=/mnt/xfstests/test/191-input-validation.img /dev/loop0
fail -r size=65536,rtdev=/mnt/xfstests/test/191-input-validation.img /dev/loop0
fail -i log=10 /dev/loop
--------------------------
"pass -d su=0,sw=64 /dev/loop0", expect fail, this behavior has been
fixed by commit 16adcb88(mkfs: more sunit/swidth sanity checking).
"fail -n log=15 /dev/sda11" "fail -i log=10 /dev/sda11", expect pass,
this option has been removed since commit 2cf637c(mkfs: remove
logarithm based CLI option).
"fail -r size=65536,rtdev=$fsimg /dev/sda11" "fail -r rtdev=$fsimg
/dev/sda11" works well if we disable reflink, fail if we enable
reflink. It fails because reflink was not supported in realtime
devices since commit bfa66ec(mkfs: don't create realtime filesystems
with reflink enabled).
Since xfsprogs v4.15.0-rc1(commit 68344ba0f mkfs: introduce default
configuration structure), we have deault sectorsize and blocksize.
So some cases without 's' or 'b' suffix trun into pass.
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
The minimum accepted allocsize mount option value is page size, which
causes the particular test to fail in architectures where page size >
block size. Fix it by basing the value on the platform page size rather
than the block size as obtained from mkfs. In addition add a filter so
that different values can be used without breaking the golden output.
Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Create a helper to run xfs_admin on the scratch device, then
refactor all tests to use it.
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>
The test currently assumes a file system block size of 4k. It will
work just fine on any user-specified block size, though.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
A handful of minor changes went into xfs_repair output in the
last push, so add a few more filters and change the resulting
expected output.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
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>
When I test this case(default lsunit 256k), this case will fail,
as below:
cycle: 1 version: 2 lsn: 1,0 tail_lsn: 1,0
length of Log Record: 258048 prev offset: -1 num ops: 1
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extended-header: cycle: 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
It reports this info because xfs_logprint only read 32k header every time, so it
needs to read more times. We can filter this useless info.
common/log also has _filter_logprint function. only library function is
prefixed with "_", remove '_'.
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
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>
`seq X Y` will print all numbers between X and Y, including Y. Since
inode chunks contain inodes numbered from X to X+63, we need to set the
loop variables correctly.
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>
If we can't create the 60T sparse image for testing repair on a large fs
(such as when running on 32-bit), don't bother running the rest of the
test. This requires the actual truncate(1) command, because it returns
nonzero if the system call fails.
[Eryu: the original bug was introduced by me when committing the
original patch, which was a correct fix. Sorry about that.. ]
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>
xfsprogs 5.4 prints "Discarding..." if the disk supports the trim
command. Filter this out of the output because xfs_info and friends
won't print that out.
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>
If we can't create the 60T sparse image for testing repair on a large fs
(such as when running on 32-bit), don't bother running the rest of the
test.
[Eryu: use xfs_io instead of truncate]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Due to the unique structure of xfs/279 running _get_scsi_debug_dev from
a backtick from inside subshell, the "could not get scsi_debug device"
checks do not actually stop the test when modprobe scsi_debug fails.
Therefore, check the value of SCSI_DEBUG_DEV from the subshell and
_notrun the test if we couldn't get memory.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Skip this test we can't create the large sparse file needed to test
overflows.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>