Use $RESIZE2FS_PROG instead of direct name to call program with full
path. Also add an appropriate feature test.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Use $RESIZE2FS_PROG and $DUMPE2FS_PROG instead of names directly to
make progs be executed with full path. Also add proper feature test
macros.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
The test uses resize2fs(8) without proper feature test macro and
also without specifying full path to it. Fix that.
Signed-off-by: Jan Kara <jack@suse.cz>
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>
Previously _scratch_mount didn't check the mount status and most
tests continue to run even if the mount failed (unless test checks
for the mount status explicitly). This would result in running tests
on the underlying filesystem (usually rootfs) and implicit test
failures, and such failures can be annoying and are usually hard to
debug.
Now _fail test by default if _scratch_mount failed and introduce
_try_scratch_mount for tests that need to check mount results
themselves.
Suggested-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.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>
An 8 MB file system may not be big enough for certain file system
configurations --- in particular, if the inode size is 2048 bytes.
Make the test file system 10MB instead.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
In all of the places where we need check to see if mkfs.ext4 can
support a set of file system features, we also should be checking to
see if the kernel can support those file system features. So rename
_require_ext4_mkfs_feature to _require_scratch_ext4_feature, and
actually format the file system in $SCRATCH_DEV.
Also allow ext4/306 to run on systems where mke2fs doesn't support
the "64bit" option.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This is obviously wrong and makes ./check -r skip over tests on ext4
with "ext4 on $DEV not configured with metadata journaling".
Signed-off-by: Ilya Dryomov <idryomov@gmail.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>
The ext4 online scrub program is no longer under active development,
so remove all the test code that tried to use it.
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>
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>
1) We add _require_ext4_mkfs_feature to check the specified
feature whether it is available in mkfs.ext4 or not.
2) We apply _require_ext4_mkfs_feature in ext4/003 and remove
_require_mkfs_mkfs_bigalloc.
3) We add _require_ext4_mkfs_feature in ext4/306. When 64bit
feature is supported by mkfs.ext4, ext4/306 could skip.
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>
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>
Move some fuzzing helper functions into a new common/fuzzy file.
We'll add a lot more fuzzing helpers in subsequent patches.
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>
Back when I created common/populate, I thought it was sufficient to
_require the tools that the populate functions need in the main
file. This turned out to be a bit sloppy, so move them into a
helper function and call it from everything that uses populate.
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>
Since commit 9538d1b69399 (ext4: avoid split extents for DAX
writes), currently sitting in ext4 tree, the block layout of files
has changed when the filesystem is mounted with -o dax and now
matches 'nodelalloc' variant instead of 'nozero'. Fixup the test
configuration.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Upstream xfs_io has been converted to always use LFS compliant
(i.e. 64 bit) pwrite() rather than pwrite64(). Similar changes have
been made for multiple syscalls that have "*64" variants. hence the
error output of all these commands has changed, such as "pwrite64:
..." to "pwrite: ....".
Make a filter to catch the *64 variants and strip it, and
convert all the golden output to use the non-*64 variant. This will
make all golden output matching work correctly regardless of what
version of xfs_io is in use.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Enhance _exclude_scratch_mount_option() function to normalize mount
options. Now it can understand and extract real mount option from
string like "-o opt1,opt2 -oopt3".
And now we do word grep to handle mount options like noinode_cache
and inode_cache.
Finally, allow it to accept multiple options at the same time. No
need for multiple _exclude_scratch_mount_option lines now
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>