Recently LTP upstream removed some ext4 tests[1]. And two of them
is still valid to keep. So I transport those two tests here.
ext4-nsec-timestamps, which is used to test nanosec timestamps of
ext4, rewrite into ext4/043 and 044. ext4-subdir-limit, which is
used to test subdirectory limit of ext4, rewrite into ext4/045.
[1] https://marc.info/?l=linux-fsdevel&m=157190623919681&w=2
Signed-off-by: Sun Yong <yosun@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Now we just kill fdatasync_work process and wait nothing after the
test, so a busy unmount failure may appear if the fdatasync syscall
doesn't return in time.
umount: /tmp/scratch: target is busy.
mount: /tmp/scratch: /dev/sdb already mounted on /tmp/scratch.
!!! failed to remount /dev/sdb on /tmp/scratch
This patch waits the xfs_io fdatasync subprocess exit to make sure
_check_scratch_fs success.
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This test exercises obsolete ext4-specific functionality that will be
removed in the kernel's 5.7 release. Once that happens, ext4/002 will
always fail, so remove the test to avoid the noise.
Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Here will check the return code of mount option. So update it
to use _try_scratch_mount.
Signed-off-by: Xiaoli Feng <xifeng@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Rename the helper functions that add/remove keys from the session
keyring, in order to distinguish them from the helper functions I'll
be adding to add/remove keys from the new filesystem-level keyring.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
The tests shared/{001,003,004,272} test behaviour around the ext4's
journal. As such, they are pointless to run on ext2, and ext3 no
longer is in kernels newer than 4.3. (And most enterprise
distributions have been using ext4 to support the ext3 file system;
that capability has been around since 2.6.33.) So we can move these
tests out of shared and into the ext4 class of tests:
shared/001 --> ext4/036
shared/003 --> ext4/037
shared/004 --> ext4/038
shared/272 --> ext4/039
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.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>
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>
For conciseness in tests, add helper functions that wrap the xfs_io
commands 'set_encpolicy' and 'get_encpolicy'. Then update all
encryption tests to use them.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Since e2fsprogs v1.44.0, debugfs with stat command shows the output:
---------------------------------------------------------------------
debugfs -R 'stat /attrfile' /dev/sda11 2> /dev/null | grep 'File ACL:'
File ACL: 9258
---------------------------------------------------------------------
Before e2fsprogs v1.44.0, debugfs with stat command shows the output:
----------------------------------------------------------------------
debugfs -R 'stat /attrfile' /dev/sda11 2> /dev/null | grep 'File ACL:'
File ACL: 9258 Directory ACL: 0
----------------------------------------------------------------------
"Directory ACL: XXXX" was removed by commit 578fcbf so running ext4/018
with older e2fsprogs(i.e. before v1.44.0) got the following error:
--------------------------------------------------------------------------
+./tests/ext4/018: line 59: 9258 Directory ACL: 0: syntax error in expression (error token is "Directory ACL: 0")
--------------------------------------------------------------------------
we match the value of File ACL accurately to fix it.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Don't require scrub for ext4's populated fs creation test because there
is no general online scrub program for ext*.
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>
Also add a requirment that fallocate and fiemap is supported.
(Fallocate isn't the case when we are emulating ext3, for example.)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Liu Bo <obuil.liubo@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Commit 6b06a9bb6f has used SCRATCH_DEV/SCRATCH_MNT rather than
TEST_DEV/TEST_DIR for holding the test files, so we need to use
SCRATCH_DEV/SCRATCH_MNT in _check_ext4_eof_flag() as well.
Fixes: 6b06a9bb6f ("ext4/002: Work with 64k block size")
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
For 64k blocksize, 10MiB as the filesystem size isn't sufficient to have
a journal included. Hence this commit computes the test FS size based on
the block size of the underlying filesystem.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit changes the script to operate on FS blocks by obtaining the
block size from the underlying filesystem and using it to perform I/O in
units of block sizes.
This commit also uses $SCRATCH_MNT rather than $TEST_DIR for holding the
test files since the FS on $TEST_DIR might be created with a different
block size than the one specified in $MKFS_OPTIONS.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
In 034.out, the $SCRATCH_MNT is specified by "/mnt/scratch". It's
not flexible. Modify it to fit the different vaule of $SCRATCH_MNT.
Signed-off-by: xiaoli feng <xifeng@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
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>
For the new version of debugfs(v1.44.0+), it changes "File ACL:" format
from "%sFile ACL: %llu Directory ACL: %d\n" to "%sFile ACL: %llu\n".
Thus, update this case accordingly.
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
14 test cases use _test_generic_punch(), and they work well as long
as the ext4/xfs blocksize or btrfs sectorsize is below 4K.
In the system with 64K pagesize, as the blocksize can be upto 64K or the
sectorsize can be 64K so 13/14 test cases fail, because the
test-file-size (20k) and thus the extent boundary offsets aren't
big enough to fit the larger than 4k extent size.
Commit 2f194e4e82 (generic/009: don't run
for btrfs if PAGE_SIZE > 4096) tried to address this by calling the
not_run in generic/009.
And in the function _test_generic_punch() we use multiple=4 to address
the similar problem but its limited to the subcommand fcollapse.
Now to run these test cases successfully on systems with pagesize 64k,
this patch propose to increase the default multiple=1 to multiple=16.
With this we increase the test file size from 20k to 320k and thus it
encapsulates maximum extent size of 64k here. And we can drop the
multiple=4 which is just being done similar for the cases of fcollapse
subcommand only. And it appears to me there is no harm in increasing
the file size and offsets in general for all commands instead of just
fcollapse command.
This change is tested on ext4, xfs and btrfs on system with pagesize
4K and 64K.
With this patch, these 14 test cases runs fine on system with 64K
pagesize as well as pagesize 4K. However we may hit the same
limitation at some point when we want to validate the FSs with
pagesizes -gt 64K. And this patch does not address that part as of
now.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Tested-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
When getfattr dumps values of all extended attributes (-d option),
it doesn't print empty extended attributes. e.g: user.name. But from
attr-2.4.48 this behavior is changed, new getfattr prints
user.name="".
The {=""} will break the golden image, so filter the redundant =""
at the end if it has.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
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>