This adds a regression test for a ENOSPC warning which can be
triggered if '-odioread_nolock,nodelalloc' and quota are used.
The bug was fixed by patch
"Ext4: fix ENOSPC when both quota and dioread_nolock are enabled".
[Eryu: add comments on using syncfs instead of sync]
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Test for overflow of s_inodes_count during filesystem resizing.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Add tests to verify Ext4 online resizing feature with bigalloc
feature enabled. We test various resizing scenarios with different
cluster sizes.
Signed-off-by: Harshad Shirwadkar <harshads@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Add a regression test for the following kernel commit:
ext4: prevent data corruption with inline data + DAX
The test passes either if we don't encounter corruption, or if
mounting with DAX + inline data fails. The latter is the way that
we prevent this issue in the kernel.
[eguan: add 'dax' group]
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Add a regression test for the following kernel commit:
ext4: prevent data corruption with journaling + DAX
The test passes if either we successfully compare the data between
the mmap with journaling turned on and the one with journaling
turned off, or if we fail the chattr command to turn on or off
journaling. The latter is how we prevent this issue in the kernel.
[eguan: add 'dax' group]
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
ea_inode feature supports creating extended attributes with values
greater than the fs block size. This test exercises some common
scenarios:
- Extended attibute being placed in inode vs xattr block
- Removing extended attribute
- Removing a file that has an extended attribute
- Multiple files having identical large attribute values
- Repeatedly setting an extended attribute with various sizes
Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
On ext4 filesystem, the kernel carshes at mount time when
s_first_meta_bg's value exceeds the largest possible meta_bg
number. This kernel bug has been fixed in:
3a4b77c ext4: validate s_first_meta_bg at mount time
[eguan: add comments on the first_meta_bg value]
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Add an ext4-specific regression test for a bug which caused ext4 to
crash when mounting a filesystem which had an encrypted inode on its
orphan list.
This bug was present in kernels v4.1 and later. It has been fixed
in v4.11-rc1, v4.10.4, v4.9.16, and v4.4.55.
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Michael Halcrow <mhalcrow@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Apparently btrfs already has tests marked as belonging in the defrag
group, but none of the ext4 or generic tests were so marked.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Previously, our XFS fuzzing efforts were limited to using the xfs_db
blocktrash command to scribble garbage all over a block. This is
pretty easy to discover; it would be far more interesting if we could
fuzz individual fields looking for unhandled corner cases. Since we
now have an online scrub tool, use it to check for our targeted
corruptions prior to the usual steps of writing to the FS, taking it
offline, repairing, and re-checking.
These tests use the new xfs_db 'fuzz' command to test corner case
handling of every field. The 'print' command tells us which fields
are available, and the fuzz command can write zeroes or ones to the
field; set the high, middle, or low bit; add or subtract numbers; or
randomize the field. We loop through all fields and all fuzz verbs to
see if we can trip up the kernel.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Define test groups for those tests which have _require_xfs_io_command
for punch, collapse, insert, and zero. This makes it easier to
exclude tests that use one of these fallocate commands. Or if you
want to specifically test for those fallocate commands you can do
this.
This obviates an out-of-tree xfstests patch I maintain which used an
XFS_IO_AVOID environment variable to suppress running tests that use
punch, collapse, insert, etc. This was rejected because of the
claim that it could be done using groups. So this commit is in
response to those upstream comments.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
ext4 supports dynamic expansion of inode size via inode's
i_extra_size field. Test the code performing the expansion in the
kernel.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Commit 688f869 fixed this bug:
ext4: Initialize fsync transaction ids in ext4_new_inode()
We manually modify jbd2 journal_superblock_s.s_sequence to be a very
large number, which will greatly reduce the time taken to trigger
this bug, though it seems some too hacked.
Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Calling EXT4_IOC_MOVE_EXTENT on file not aligned with block size and
block size is smaller than page size would cause integrity issue on the
partial-blocksize part when copying data between orign file and donor
file.
This ext4 kernel patch would fix it, titled
"ext4: don't read blocks from disk after extents being swapped in
move_extent_per_page())"
Though this bug only happens in the blocksize smaller than pagesize
case, there's no harm to test on various block size fs, so no block size
is specified in the test, it depends on the test configurations.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
The ext4/301, ext4/302, ext4/303, and ext4/304 tests are not crashing
on 3.10.89, 3.14.53, 3.18.21, 4.1.8, and 4.3-rc2. So promote these
tests from the dangerous to the auto group.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Targeted fuzzing tests which destroy various pieces of file,
directory, and symlink metadata; the tests look for (a) kernel
detection of corruption, (b) e2fsck repair of said corruption, and (c)
post-repair fs usability.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Targeted fuzzing tests which destroy various pieces of filesystem or
block group metadata; the tests look for (a) kernel detection of
corruption, (b) e2fsck repair of said corruption, and (c) post-repair
fs usability.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Introduce tests for XFS and ext4 which format a filesystem, populate
it, then uses blocktrash and e2fuzz to corrupt the metadata. The FS
is remounted, modified, and unmounted. Following that, xfs_repair or
e2fsck are run until it no longer finds errors to correct, after which
the FS is mounted yet again and exercised to see if there are any
errors remaining.
The XFS test requires an xfs_db that can handle blocktrash and v5
filesystems.
The ext4 test requires metadata_csum support in e2fsprogs.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
On unpatched kernel, converting file with a hole at the beginning to
non-extent based format results in ext4 i_blocks corruption. Add a new
regression test case for it.
These two commits fixed the corruption:
ext4: be more strict when migrating to non-extent based file
ext4: correctly migrate a file with a hole at the beginning
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This test case will first use fsstress to fill a file system, then
dump it to standard output and restore it from standard input, finally
check that the original contents and the new contents generated by
restore tool will be same.
Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.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_MOVE_EXTENT is ready to support case where orig_offset != donor_offset.
This case is usable for compacting small files together.
Test generate file hierarchy via fsstress and then compact all files
to one adjacent block.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Regression test for:
b5b6077 ext4: fix wrong assert in ext4_mb_normalize_request()
Meanwhile make minor changes to _scratch_mkfs_ext4() in common/rc,
_scratch_mkfs_ext4() might fail due to conflicts between being passed options
and MKFS_OPTIONS. We fix this by ignoring MKFS_OPTIONS if it fails the first
time(see _scratch_mkfs_xfs()), as suggested by Lukas Czerner.
[dchinner: converted to use xfs_io]
Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
The test shared/243 really is ext4 specific even though currently we
would run it on other file systems as well, it would not actually do any
testing.
So move it to ext4 specific directory and rename it to 002.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>