This test exposed a problem with XFS where it failed to write back a
partial page correctly during a fcollapse operation. This left a
stray dirty buffer on the page, and hence invalidation of the page
then failed of the fcollapse returned an EBUSY error.
Make this a generic test so that we can ensure that all filesystems
handle the case correctly. Test case originally worked out and
written by Brian Foster.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This test exposed a problem with mapped writes to the tail page of a
file in XFS and potentially ext4. Eric did all the hard work of
taking the bug report and generating the reproducable test case on
ext4. Make it a generic test so that we can ensure that all
filesystems handle the case correctly.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This test exposed a problem with mapped writes to the tail page of a
file in XFS. Hence make it a generic test so taht we can ensure that
all fielsystems handle the case correctly.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
xfs/200 leaves a dirty log as readonly filesystems don't write
unmount records to mark the log clean.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
I'm getting enospc errors on a 4GB test device after a while of
running. Part of the issue is that many tests can't or don't clean
up previous failed runs when they start or if the run to success.
Hence while we want to slowly age the test filesystem, we don't
really want that aging to unintentionally run the filesystem out of
space. To that end:
$ sudo du -s /mnt/test/* | sort -nr |head -10
1929160 /mnt/test/fsfile
512000 /mnt/test/247.8133
512000 /mnt/test/247.4713
512000 /mnt/test/247.4488
466752 /mnt/test/fstest.9850.2
40000 /mnt/test/resv
29804 /mnt/test/fsstress.12144.1
26208 /mnt/test/populate_root
26208 /mnt/test/mnt
23216 /mnt/test/fsstress.4491.1
We can see that there are a few tests that using most of the space.
These are often left behind due to kernel failures during tests or
reboots while tests are in progress, so make sure that they at least
clean up such mess the next time they run.
Test generic/247, xfs/020 (fsfile) and generic/074 (fstest.$$.n)
are the worst offenders, so just target these to being with.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This test tries to directly corrupt the CRC field of the primary
superblock by using xfs_io pwrite, but never syncs it to disk,
so it's quite likely that the mount will not see the bad data.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
These two tests blow up on the scratch test, but 011 leaves the devices in a
state where the first scratch dev is no longer part of any file system and 012
leaves the scratch dev as an ext4 file system. Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Regression test for btrfs where removing the flag FS_COMPR_FL
(chattr -c) from an inode wouldn't clear its compression property.
This was fixed in the following linux kernel patch:
Btrfs: add missing compression property remove in btrfs_ioctl_setflags
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
We don't need to make a full-sized file system in order to test
whether "mkfs.ext4 -O bigalloc" works.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Using "yes | mkfs.ext4 ..." results in the error message results in
the test failing, at least for some versions of e2fsprogs:
+yes: standard output: Broken pipe
+yes: write error
It better to use the -F option, which will eliminate the questions.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
A buffer use after free race was discovered in the XFS log recovery
codepath if I/O failures occur during recovery. The I/O submission path
can abort the mount and release the only reference held on some buffers
before I/O completion processing (e.g., async workqueue processing)
might have completed. Badness ensues if the I/O completion path
subsequently attempts to access said buffers.
The test manufactures the race by forcing all writes to fail (via
dm-flakey) after a fixed period of time. A delay is inserted into the
mount codepath to synchronize write failures with log recovery.
Credit for discovery of the race and definition of the reproducible test
case goes to Alex Lyakas.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reported-by: Alex Lyakas <alex@zadarastorage.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
_require_xfs_sysfs() currently assumes that all sysfs attributes reside
under a device-specific subdirectory in the XFS sysfs hierarchy. It is
hardcoded to use the TEST_DEV mount and expect the relative attribute
path as a parameter.
Not all sysfs attributes are associated with specific devices or mount
points, however. Remove the hardcoded device name part of the attribute
path from _require_xfs_sysfs() and let the caller construct the relative
path based on the sysfs XFS root directory.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Some file system configurations don't support fallocate, which is
required for e4defrag to run. So add a _require_xfs_io_command to
prevent a test failure if fallocate isn't supported in (for example)
ext3 compatibility mode.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This test is motivated by a btrfs issue where a ranged fsync would
prevent a subsequent fsync from persisting any extents that were
dirty at the time of the first fsync but that were outside the range
of that first fsync (which should have been persisted by the second
fsync).
This bug in btrfs is fixed by the following linux kernel patch:
Btrfs: fix fsync data loss after a ranged fsync
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
CIFS/SMB protocol without POSIX extensions doesn't support operations
with symbolic links and advisory byte-range locks from the same process.
Add checks these features and use them in generic tests that require
such operations.
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Reviewed-by: Steve French <smfrench@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Pass -cifs argument from the command line to enable cifs testing
for $TEST_DEV. Also mention CIFS and missed UDF in README.
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Reviewed-by: Steve French <smfrench@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
The existing code calls remount for $TEST_DEV with constantly defined
mount options. This can fail if a user specifies different mount options.
Fix this by using new _test_remount() call that remounts $TEST_DEV.
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Reviewed-by: Steve French <smfrench@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Check data integrity and layout stability during defrag compacting
EXT4_IOC_MOVE_EXT swap extents between target and donor inode.
If ioctl was performed twice then inode's layout should not change.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>
EXT4_IOC_MOVE_EXT requires both files has same offset inside page
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Currently default block size is frozen to 4096 which is bad for
various reasons. e.g:
1) It ignores MKFS_OPT
2) Does not work for architectures where PG_SIZE != 4096
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
New xfs_repair programs have a different sunit/swidth warning that
is triggering failures such as:
-Note - stripe unit (0) and width (0) fields have been reset.
-Please set with mount -o sunit=<value>,swidth=<value>
+Note - stripe unit (0) and width (0) were copied from a backup superblock.
+Please reset with mount -o sunit=<value>,swidth=<value> if necessary
Update the filter to catch both cases and output the old message so
tests pass again.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>