With "_require_xfs_io_command chattr <letter>", check that
flag can be set/cleared using FS_IOC_FSSETXATTR ioctl, similar
to "_require_chattr <letter>" and FS_IOC_SETFLAGS ioctl.
Update the documentation and the tests that use
"_require_xfs_io_command chattr" to test filesystem support
and not only xfs_io support.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
In _require_xfs_io_command, when command fails for one of the
generic reasons, if command was tested with params, print out
the params of the failed command.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Right at the beginning of the test we are unmonting the scratch device,
however at this point the device was never mounted, so the unmount fails
with an error message like the following:
umount: /home/fdmanana/btrfs-tests/scratch_1: not mounted
Which is not expected by the golden output and therefore causes the test
to fail.
Since the device/mount point was not mounted yet in the test, and since
the test framework unmounts the scratch device after each test finishes,
just remove the call to _scratch_unmount.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
For the t_open_tmpfiles tests that run multiple jobs in parallel,
limit ourselves to half of file-max for all jobs combined,
so that we don't OOM the test machine.
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>
This test creates a file system with a 1k block size. Since there
are no architectures with a 1k page size, the test file system can
never be mounted with DAX enabled, causing the test to fail.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Yang Xu<xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Depending on filesystem, copying from active swapfile may be allowed,
just as read from swapfile may be allowed.
Note the kernel fix commit in test description.
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>
If no tests are run (because they have all been excluded) then make
sure we insert a valid timestamp into the XML file, and avoid printing
an error message when reading a non-existent test summary scratch
file.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Move some tests to the copy_range group so they are distinct
from the copy group which refers to xfs_copy tests.
[Amir] Revert copy past EOF behavior change
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Some of the tests in xfstests (e.g. generic/224 with 512M of memory)
consume a lot of memory, and when this happens the OOM killer will
run around stomping on processes. Sometimes it kills the ./check
process before it kills the actual test, which means that the test
run doesn't complete.
Therefore, make the ./check process OOM-proof while bumping up the
attractiveness of the test itself, in the hopes that even if the
test OOMs we'll still be able to continue on our way.
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>
Convert 'xfs_foo_t' typedef usage to 'struct xfs_foo' in preparation
for changes to some of the xfs ioctls.
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>
Check that if we write some data to a file, its inode gets evicted
(while its parent directory's inode is not evicted due to being in
use), then we rename the file and fsync it, after a power failure
the file data is not lost.
This currently passes on xfs, ext4 and f2fs but fails on btrfs. The
following patch for btrfs fixes it:
"Btrfs: fix data loss after inode eviction, renaming it, and fsync it"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
The current btrfs/048 test-case did not check the behavior of
properties with options like compression and with the compression
level supplied.
Add test cases for compression with compression level as well so we
can be sure we don't regress there.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
There is a long lived bug that btrfs wait for readahead to finish
indefinitely when readahead zone is inserted into seed devices.
Current write size to the file "foobar" is too small to run readahead
before the replacing on seed device. So, increase the write size to
reproduce the issue.
Following patch fixes it:
"btrfs: start readahead also in seed devices"
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Add tests for overlayfs mounts with:
- Same upperdir/lowerdir
- Overlapping upperdir/lowerdir
- Overlapping lowerdir layers
- Overlapping lowerdir with other mount upperdir/workdir
Add test for moving layer into another after mount.
Overlapping layers on mount or lookup results in ELOOP.
Overlapping lowerdir with other mount upperdir/workdir
result in EBUSY.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Some valid test cases about fsck.overlay may be not valid enough now,
they lose the impure xattr on the parent directory of the simluated
redirect directory, and lose the whiteout which use to cover the origin
lower object. Then fsck.overlay will fix these two inconsistency which
are not those test cases want to cover, thus it will lead to
fsck.overlay return FSCK_NONDESTRUCT instead of FSCK_OK. Fix these by
complement the missing overlay related features.
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
fsck.overlay should return correct exit code to show the file system
status after fsck, instead of return 0 means consistency and !0 means
inconsistency or something bad happened.
Fix the following three exit code after running fsck.overlay:
- Return FSCK_OK if the input file system is consistent,
- Return FSCK_NONDESTRUCT if the file system inconsistent errors
corrected,
- Return FSCK_UNCORRECTED if the file system still have inconsistent
errors.
This patch also add a helper function to run fsck.overlay and check
the return value is expected or not.
[amir] rename helper to _overlay_fsck_expect, split define of FSCK_*
to a seprate path.
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
_repair_scratch_fs did not do the right thing for overlay.
Implement and call _repair_overlay_scratch_fs to repair
overlay filesystem and then fall through to repair base filesystem.
The only tests currentrly calling _repair_scratch_fs on a
./check -overlay run are generic/330 generic/332 in case the
base fs supports reflink. The rest of the tests calling
_repair_scratch_fs require that $SCRATCH_DEV is a block device.
Suggested-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
_dump_err2() helper was introduced over two years ago and it broke
the error reporting from _repair_scratch_fs.
Every test that runs:
_repair_scratch_fs >> $seqres.full
and expect to fail if anything is written to stderr is not working
as intended.
Reported-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This adds a regression test for online resizing maximum blocks
which can trigger a BUG_ON with non-zero s_first_data_block
filesystem.
The bug was fixed by patch:
f96c3ac8dfc2 ("ext4: fix crash during online resizing")
The bug was introduced by patch:
1c6bd7173d66 ("ext4: convert file system to meta_bg if needed during
resizing")
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Use _scratch_xfs_repair helper instead of calling xfs_repair
directly, as local.config may want to define $XFS_REPAIR_PROG
and override the default binary in the search path.
Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>