xfstests: fix up various tmpfs failures
cover xfstests: fix up various tmpfs failures
I've been trying to sync up our internal xfststs tree at $WORK with the latest upstream xfstests tree, and have been cleaning up the patches so that they will hopefully be suitable for upstream merging. This is most of the changes we have for tmpfs support. I've left out a few that I suspect should be fixed in other ways (e.g., in our automated test framework).
With these changes all of the auto group tests are passing with tmpfs with a the exception of generic/80 (which looks like a genuine test failure) and generic/269 and generic/273 which are causing an OOM kill (tmpfs allows an infinite number of inodes to be created until kmalloc() fails or the test or the test runner gets killed with an OOM kill).
I've disabled generic/027 for tmpfs for similar ENOSPC-related reasons; we may want to do something similar for generic/269 and generic/273 but I want to do a more in-depth examination of those tests to be sure that there isn't an easy way to fix those tests for tmpfs.
Hugh Dickins (8):
common: _scratch_mkfs_sized() for tmpfs
generic: use mount point instead of device name
generic: add _require_odirect to three more tests
generic: require fiemap for generic/009
xfstests: fix generic/312 on tmpfs, ignore /proc/partitions
xfstests: generic/079 requires chattr, not xattrs
xfstests: add executable permission to tests
xfstests: increase tmpfs memory size
Junho Ryu (2):
xfstests: do not unmount tmpfs during remount
generic: do not unmount before calling _check_scratch_fs()
Theodore Ts'o (2):
check: avoid error messages of tests/$FS does not exist
generic: disable generic/027 for tmpfs
check | 6 ++++++ common/config | 4 ++-- common/rc | 35 ++++++++++++++++++++++++++++++----- tests/generic/003 | 12 ++++-------- tests/generic/009 | 2 ++ tests/generic/027 | 1 + tests/generic/053 | 2 -- tests/generic/053.out | 2 -- tests/generic/058 | 0 tests/generic/060 | 0 tests/generic/061 | 0 tests/generic/063 | 0 tests/generic/079 | 2 +- tests/generic/113 | 1 + tests/generic/125 | 1 + tests/generic/135 | 17 +++-------------- tests/generic/169 | 20 ++++++-------------- tests/generic/169.out | 6 ++---- tests/generic/192 | 3 +-- tests/generic/214 | 1 + tests/generic/226 | 3 +-- tests/generic/258 | 3 +-- tests/generic/273 | 2 +- tests/generic/306 | 3 +-- tests/generic/312 | 11 ++++++----- tests/generic/317 | 3 +-- tests/generic/318 | 3 +-- 27 files changed, 73 insertions(+), 70 deletions(-) mode change 100644 => 100755 tests/generic/058 mode change 100644 => 100755 tests/generic/060 mode change 100644 => 100755 tests/generic/061 mode change 100644 => 100755 tests/generic/063
Signature · 1 line
2.5.0
PATCH 4/12 generic: add _require_odirect to three more tests
From: Hugh Dickins <[email protected]>
generic/113, generic/125, generic/214 each use O_DIRECT at some stage in their tests, so check O_DIRECT support before running them.
--- tests/generic/113 | 1 + tests/generic/125 | 1 + tests/generic/214 | 1 + 3 files changed, 3 insertions(+)
tests/generic/113 +1 -0
@@ -77,6 +77,7 @@ _do_test() _supported_fs generic _supported_os Linux _require_test +_require_odirect [ -x $here/ltp/aio-stress ] || _notrun "aio-stress not built for this platform"
tests/generic/125 +1 -0
@@ -41,6 +41,7 @@ _supported_os Linux _require_test _require_user +_require_odirect TESTDIR=$TEST_DIR/ftrunc TESTFILE=$TESTDIR/ftrunc.tmp
tests/generic/214 +1 -0
@@ -55,6 +55,7 @@ rm -f $seqres.full rm -f $TEST_DIR/ouch* _require_xfs_io_command "falloc" +_require_odirect # Ok, off we go.
Signature · 1 line
2.5.0
PATCH 6/12 generic: do not unmount before calling _check_scratch_fs()
In reply to Theodore Ts'oFrom: Junho Ryu <[email protected]>
Fix generic/053 so it works on tmpfs by relying on _check_scratch_fs to unmount before checking the file system and remounting it afterwards. Many other tests rely on this, and since tmpfs does not have a file system consistency checker, this allows the test to succeed because the files don't disappear when the tmpfs file system is unmounted.
--- tests/generic/053 | 2 -- tests/generic/053.out | 2 -- 2 files changed, 4 deletions(-)
tests/generic/053 +0 -2
@@ -81,9 +81,7 @@ list_acls() echo "acls before repair:" list_acls -_do 'unmount $SCRATCH_DEV' '_scratch_unmount' _do 'repair filesystem' '_check_scratch_fs' -_do 'mount filesytem' '_scratch_mount' echo "acls after repair: " list_acls
tests/generic/053.out +0 -2
@@ -10,9 +10,7 @@ $SCRATCH_MNT/test.4 [u::---,g::r-x,o::rwx] $SCRATCH_MNT/test.5 [u::---,u:id2:r-x,g::---,m::rwx,o::---] $SCRATCH_MNT/test.6 [u::rwx,g::r-x,o::r--] $SCRATCH_MNT/test.7 [u::---,g::---,g:id2:r-x,m::-w-,o::---] -unmount $SCRATCH_DEV... done repair filesystem... done -mount filesytem... done acls after repair: $SCRATCH_MNT/test.0 [u::r--,g::rwx,o::rw-] $SCRATCH_MNT/test.1 [u::r-x,g::---,o::---]
Signature · 1 line
2.5.0
PATCH 7/12 generic: require fiemap for generic/009
In reply to Theodore Ts'oFrom: Hugh Dickins <[email protected]>
Require xfs_io commands fiemap and falloc as well as fzero: fzero without falloc is unlikely, but tmpfs may later support fzero, though probably never fiemap (and in v3.15 wrongly claimed to support fzero).
--- tests/generic/009 | 2 ++ 1 file changed, 2 insertions(+)
tests/generic/009 +2 -0
@@ -45,6 +45,8 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_os Linux _require_xfs_io_command "fzero" +_require_xfs_io_command "fiemap" +_require_xfs_io_command "falloc" _require_test testfile=$TEST_DIR/009.$$
Signature · 1 line
2.5.0
PATCH 8/12 xfstests: fix generic/312 on tmpfs, ignore /proc/partitions
In reply to Theodore Ts'oFrom: Hugh Dickins <[email protected]>
312 avoid reading /proc/partitions for tmpfs, just assume enough space.
--- tests/generic/312 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
tests/generic/312 +6 -5
@@ -51,12 +51,13 @@ _require_scratch # 5G in byte fssize=$((2**30 * 5)) -required_blocks=$(($fssize / 1024)) -dev_blocks=$(grep -w $(_short_dev $SCRATCH_DEV) /proc/partitions | $AWK_PROG '{print $3}') -if [ $required_blocks -gt $dev_blocks ];then - _notrun "this test requires \$SCRATCH_DEV has ${fssize}B space" +if [ "$FSTYP" != "tmpfs" ]; then + required_blocks=$(($fssize / 1024)) + dev_blocks=$(grep -w $(_short_dev $SCRATCH_DEV) /proc/partitions | $AWK_PROG '{print $3}') + if [ $required_blocks -gt $dev_blocks ];then + _notrun "this test requires \$SCRATCH_DEV has ${fssize}B space" + fi fi - rm -f $seqres.full _scratch_mkfs_sized $fssize >>$seqres.full 2>&1 _scratch_mount >>$seqres.full 2>&1
Signature · 1 line
2.5.0
PATCH 9/12 xfstests: generic/079 requires chattr, not xattrs
In reply to Theodore Ts'oFrom: Hugh Dickins <[email protected]>
--- tests/generic/079 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/generic/079 +1 -1
@@ -48,7 +48,7 @@ _cleanup() _supported_fs generic _supported_os Linux -_require_attrs +_require_chattr _require_scratch [ -x $timmutable ] || _notrun "t_immutable was not built for this platform"
Signature · 1 line
2.5.0
PATCH 10/12 generic: disable generic/027 for tmpfs
In reply to Theodore Ts'oThe generic/027 test creates a large number of 1k files until the file creation fails. On other file systems there will be a large number zero length files because the block allocation has failed, but there are still inodes available, and so the file creation loop runs until the file system runs out of inodes.
With tmpfs, we can limit the size of the file system, which limits the block allocation, but there is no limit to the number of inodes that can be created until kmalloc() fails --- or the OOM killer kills the test. So this causes this test to run for a long, long time, and in some cases the test or the test runner will get OOM killed instead. We have other ENOSPC tests, so given that tmpfs is just so different from all other file systems, it's simpler just to disable this test for tmpfs than to try to make it work.
--- tests/generic/027 | 1 + 1 file changed, 1 insertion(+)
tests/generic/027 +1 -0
@@ -59,6 +59,7 @@ create_file() # real QA test starts here _supported_fs generic _supported_os Linux +[ "$FSTYP" == tmpfs ] && _notrun "Test is not suitable for tmpfs" _require_scratch
Signature · 1 line
2.5.0
PATCH 11/12 xfstests: add executable permission to tests
In reply to Theodore Ts'oFrom: Hugh Dickins <[email protected]>
--- tests/generic/058 | 0 tests/generic/060 | 0 tests/generic/061 | 0 tests/generic/063 | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tests/generic/058 mode change 100644 => 100755 tests/generic/060 mode change 100644 => 100755 tests/generic/061 mode change 100644 => 100755 tests/generic/063
tests/generic/058 +0 -0
tests/generic/060 +0 -0
tests/generic/061 +0 -0
tests/generic/063 +0 -0
Signature · 1 line
2.5.0
PATCH 1/12 check: avoid error messages of tests/$FS does not exist
In reply to Theodore Ts'oThere are no tmpfs specific tests, so tests/tmpfs does not exist. Avoid print an error message caused by trying to read the file tests/tmpfs/group (for example).
--- check | 6 ++++++ 1 file changed, 6 insertions(+)
check +6 -0
@@ -90,6 +90,9 @@ get_group_list() grp=$1 for d in $SRC_GROUPS $FSTYP; do + if ! test -d "$SRC_DIR/$d" ; then + continue + fi l=$(sed -n < $SRC_DIR/$d/group \ -e 's/#.*//' \ -e 's/$/ /' \
@@ -105,6 +108,9 @@ get_all_tests() { touch $tmp.list for d in $SRC_GROUPS $FSTYP; do + if ! test -d "$SRC_DIR/$d" ; then + continue + fi ls $SRC_DIR/$d/* | \ grep -v "\..*" | \ grep "^$SRC_DIR/$d/$VALID_TEST_NAME"| \
Signature · 1 line
2.5.0
PATCH 3/12 generic: use mount point instead of device name
In reply to Theodore Ts'oFrom: Hugh Dickins <[email protected]>
A tmpfs mount does not involve any block device, its $SCRATCH_DEV is nothing but a place-holder, so apply 'df' or 'stat' to its mount point $SCRATCH_MNT instead of to $SCRATCH_DEV.
--- tests/generic/273 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/generic/273 +1 -1
@@ -68,7 +68,7 @@ _file_create() cd $SCRATCH_MNT/origin - _disksize=`$DF_PROG -B 1 $SCRATCH_DEV | tail -1 | $AWK_PROG '{ print $5 }'` + _disksize=`$DF_PROG -B 1 $SCRATCH_MNT | tail -1 | $AWK_PROG '{ print $5 }'` _disksize=$(($_disksize / 3)) _num=$(($_disksize / $count / $threads / 4096)) _count=$count
Signature · 1 line
2.5.0
PATCH 5/12 xfstests: do not unmount tmpfs during remount
In reply to Theodore Ts'oFrom: Junho Ryu <[email protected]>
Several tests unmount then re-mount the scratch filesystem, to check that the content is unchanged; but unmounting a tmpfs is designed to lose its content, which causes such tests to fail unnecessarily.
--- common/rc | 30 ++++++++++++++++++++++++++---- tests/generic/003 | 12 ++++-------- tests/generic/135 | 17 +++-------------- tests/generic/169 | 20 ++++++-------------- tests/generic/169.out | 6 ++---- tests/generic/192 | 3 +-- tests/generic/226 | 3 +-- tests/generic/258 | 3 +-- tests/generic/306 | 3 +-- tests/generic/317 | 3 +-- tests/generic/318 | 3 +-- 11 files changed, 47 insertions(+), 56 deletions(-)
common/rc +26 -4
@@ -331,8 +331,19 @@ _scratch_unmount() _scratch_remount() { - _scratch_unmount - _scratch_mount + case $FSTYP in + tmpfs) + OPTS="$@" + if test -n "$OPTS"; then + OPTS=$(echo $OPTS | sed -e 's/-o /-o remount,/') + mount $OPTS $SCRATCH_MNT + fi + ;; + *) + _scratch_unmount + _scratch_mount "$@" + ;; + esac } _test_mount()
@@ -356,8 +367,19 @@ _test_unmount() _test_remount() { - _test_unmount - _test_mount + case $FSTYP in + tmpfs) + OPTS="$@" + if test -n "$OPTS"; then + OPTS=$(echo $OPTS | sed -e 's/-o /-o remount,/') + mount $OPTS $SCRATCH_DIR + fi + ;; + *) + _test_unmount + _test_mount "$@" + ;; + esac } _scratch_mkfs_options()
tests/generic/003 +4 -8
@@ -108,8 +108,7 @@ _compare_stat_times NNN "$file1_stat_after_first_access" \ "$file1_stat_after_second_access" "after accessing file1 second time" # Remounting with nodiratime option -_scratch_unmount -_scratch_mount "-o nodiratime" +_scratch_remount "-o nodiratime" file1_stat_after_remount=`_stat $TPATH/dir1/file1` _compare_stat_times NNN "$file1_stat_after_second_access" \ "$file1_stat_after_remount" "for file1 after remount"
@@ -135,8 +134,7 @@ _compare_stat_times NNN "$dir2_stat_after_file_creation" \ "$dir2_stat_after_file_access" "for dir2 after file access" # Remounting with noatime option, creating a file and accessing it -_scratch_unmount -_scratch_mount "-o noatime" +_scratch_remount "-o noatime" echo "ccc" > $TPATH/dir2/file3 file3_stat_before_first_access=`_stat $TPATH/dir2/file3` sleep 1
@@ -160,8 +158,7 @@ _compare_stat_times NNY "$file1_stat_after_modify" \ # Remounting with strictatime option and # accessing a previously created file twice -_scratch_unmount -_scratch_mount "-o strictatime" +_scratch_remount "-o strictatime" cat $TPATH/dir2/file3 > /dev/null file3_stat_after_second_access=`_stat $TPATH/dir2/file3` _compare_stat_times YNN "$file3_stat_after_first_access" \
@@ -194,8 +191,7 @@ fi sleep 1 dir2_stat_before_ro_mount=`_stat $TPATH/dir2` file3_stat_before_ro_mount=`_stat $TPATH/dir2/file3` -_scratch_unmount -_scratch_mount "-o ro,strictatime" +_scratch_remount "-o ro,strictatime" ls $TPATH/dir2 > /dev/null cat $TPATH/dir2/file3 > /dev/null dir2_stat_after_ro_mount=`_stat $TPATH/dir2`
tests/generic/135 +3 -14
@@ -41,19 +41,8 @@ _supported_os Linux IRIX _require_odirect _require_scratch -_scratch_mkfs >/dev/null 2>&1 - -_umount_mount() -{ - CWD=`pwd` - cd / - # pipe error into /dev/null, in case not mounted (after _require_scratch) - _scratch_unmount 2>/dev/null - _scratch_mount - cd "$CWD" -} - -_umount_mount +_scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed" +_scratch_mount > /dev/null 2>&1 || _fail "mount failed" cd $SCRATCH_MNT
@@ -71,7 +60,7 @@ $XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x78 0 4k' trunc_file > /dev/null $XFS_IO_PROG -f -c 'truncate 2k' trunc_file > /dev/null $XFS_IO_PROG -c 'pwrite 1k 0 1k' trunc_file > /dev/null -_umount_mount +_scratch_remount # check file size and contents od -Ad -x async_file
tests/generic/169 +6 -14
@@ -73,13 +73,9 @@ $XFS_IO_PROG -a -c "pwrite 0 5k" -c "fsync" \ $SCRATCH_MNT/testfile \ | _show_wrote_and_stat_only -echo "# unmounting scratch" -_scratch_unmount>>$seqres.full 2>&1 \ - || _fail "unmount failed" - -echo "# mounting scratch" -_scratch_mount >>$seqres.full 2>&1 \ - || _fail "mount failed: $MOUNT_OPTIONS" +echo "# remounting scratch" +_scratch_remount >>$seqres.full 2>&1 \ + || _fail "remount failed: $MOUNT_OPTIONS" echo "# stating file to confirm correct size" $XFS_IO_PROG -r -c "stat" $SCRATCH_MNT/testfile \
@@ -90,13 +86,9 @@ $XFS_IO_PROG -f -c "pwrite 0 5" -c s -c "pwrite 5 5" \ -c "stat" $SCRATCH_MNT/nextfile \ | _show_wrote_and_stat_only -echo "# unmounting scratch" -_scratch_unmount>>$seqres.full 2>&1 \ - || _fail "unmount failed" - -echo "# mounting scratch" -_scratch_mount >>$seqres.full 2>&1 \ - || _fail "mount failed: $MOUNT_OPTIONS" +echo "# remounting scratch" +_scratch_remount >>$seqres.full 2>&1 \ + || _fail "remount failed: $MOUNT_OPTIONS" echo "# stating file to confirm correct size" $XFS_IO_PROG -r -c "stat" $SCRATCH_MNT/nextfile \
tests/generic/169.out +2 -4
@@ -5,15 +5,13 @@ wrote 5120/5120 bytes at offset 0 wrote 5120/5120 bytes at offset 5120 wrote 5120/5120 bytes at offset 10240 stat.size = 15360 -# unmounting scratch -# mounting scratch +# remounting scratch # stating file to confirm correct size stat.size = 15360 # appending 10 bytes to new file, sync at 5 bytes wrote 5/5 bytes at offset 0 wrote 5/5 bytes at offset 5 stat.size = 10 -# unmounting scratch -# mounting scratch +# remounting scratch # stating file to confirm correct size stat.size = 10
tests/generic/192 +1 -2
@@ -78,8 +78,7 @@ cat $testfile time2=`_access_time $testfile | tee -a $seqres.full` cd / -_test_unmount -_test_mount +_test_remount time3=`_access_time $testfile | tee -a $seqres.full` delta1=`expr $time2 - $time1`
tests/generic/226 +1 -2
@@ -61,8 +61,7 @@ for I in `seq 1 $loops`; do done echo -_scratch_unmount -_scratch_mount +_scratch_remount echo "--> $loops direct 64m writes in a loop" for I in `seq 1 $loops`; do
tests/generic/258 +1 -2
@@ -62,8 +62,7 @@ fi # unmount, remount, and check the timestamp echo "Remounting to flush cache" -_test_unmount -_test_mount +_test_remount # Should yield -315593940 (prior to epoch) echo "Testing for negative seconds since epoch"
tests/generic/306 +1 -2
@@ -67,8 +67,7 @@ touch $BINDFILE || _fail "Could not create bind mount file" touch $TARGET || _fail "Could not create symlink target" ln -s $TARGET $SYMLINK -_scratch_unmount || _fail "Could not unmount scratch device" -_scratch_mount -o ro || _fail "Could not mount scratch readonly" +_scratch_remount -o ro || _fail "Could not remount scratch readonly" # We should be able to read & write to/from these devices even on an RO fs echo "== try to create new file"
tests/generic/317 +1 -2
@@ -96,8 +96,7 @@ echo "" echo "*** Remounting ***" echo "" sync -_scratch_unmount >>$seqres.full 2>&1 -_scratch_mount >>$seqres.full 2>&1 || _fail "mount failed" +_scratch_remount >>$seqres.full 2>&1 || _fail "remount failed" _print_numeric_uid
tests/generic/318 +1 -2
@@ -109,8 +109,7 @@ _print_getfacls echo "*** Remounting ***" echo "" sync -_scratch_unmount >>$seqres.full 2>&1 -_scratch_mount >>$seqres.full 2>&1 || _fail "mount failed" +_scratch_remount >>$seqres.full 2>&1 || _fail "remount failed" _print_getfacls
Signature · 1 line
2.5.0
PATCH 12/12 xfstests: increase tmpfs memory size
In reply to Theodore Ts'oFrom: Hugh Dickins <[email protected]>
512M is not enough for generic/129. Raise default tmpfs size to 1G.
--- common/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
common/config +2 -2
@@ -316,8 +316,8 @@ _mount_opts() export MOUNT_OPTIONS="-o acl $GFS2_MOUNT_OPTIONS" ;; tmpfs) - # We need to specify the size at mount, use 512 MB by default - export MOUNT_OPTIONS="-o size=512M $TMPFS_MOUNT_OPTIONS" + # We need to specify the size at mount, use 1G by default + export MOUNT_OPTIONS="-o size=1G $TMPFS_MOUNT_OPTIONS" ;; *) ;;
Signature · 1 line
2.5.0
PATCH 2/12 common: _scratch_mkfs_sized() for tmpfs
In reply to Theodore Ts'oFrom: Hugh Dickins <[email protected]>
_scratch_mkfs_sized() avoid blockdev and update MOUNT_OPTIONS with required size on tmpfs, so those tests using it can now run.
--- common/rc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
common/rc +4 -1
@@ -813,7 +813,7 @@ _scratch_mkfs_sized() blocks=`expr $fssize / $blocksize` - if [ "$HOSTOS" == "Linux" ]; then + if [ "$HOSTOS" == "Linux" -a -b "$SCRATCH_DEV" ]; then devsize=`blockdev --getsize64 $SCRATCH_DEV` [ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small" fi
@@ -849,6 +849,9 @@ _scratch_mkfs_sized() sector_size=`blockdev --getss $SCRATCH_DEV` $MKFS_F2FS_PROG $MKFS_OPTIONS $SCRATCH_DEV `expr $fssize / $sector_size` ;; + tmpfs) + export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS" + ;; *) _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized" ;;
Signature · 1 line
2.5.0
Here is the output of "gce-xfstests -c tmpfs -g auto" with these patches.
- Ted
CMDLINE: -c tmpfs -g auto
FSTESTVER: e2fsprogs v1.43-WIP-2015-05-18-64-g2334bd3 (Sat, 5 Sep 2015 22:21:35 -0400)
FSTESTVER: fio fio-2.6-8-ge6989e1 (Thu, 4 Feb 2016 12:09:48 -0700)
FSTESTVER: quota 7367f5d (Wed, 27 Jan 2016 12:16:25 +0100)
FSTESTVER: xfsprogs v4.2.0 (Mon, 7 Sep 2015 10:14:31 +1000)
FSTESTVER: xfstests-bld 0f62f62 (Tue, 9 Feb 2016 20:11:45 -0500)
FSTESTVER: xfstests linux-v3.8-906-ga687f46 (Tue, 9 Feb 2016 20:07:42 -0500)
FSTESTVER: kernel 4.5.0-rc2-ext4-00002-g6df2762 #155 SMP Mon Feb 8 12:32:59 EST 2016 x86_64
FSTESTCFG: "tmpfs"
FSTESTSET: "-g auto"
FSTESTEXC: ""
FSTESTOPT: "aex"
MNTOPTS: ""
CPUS: "2"
MEM: "7477.45"
MEM: 7680 MB (Max capacity)
BEGIN TEST tmpfs: tmpfs Tue Feb 9 20:56:48 EST 2016MKFS_OPTIONS -- test:/scratchMOUNT_OPTIONS -- -o size=1G test:/scratch /test/scratch
Ran: generic/001 generic/002 generic/003 generic/004 generic/005 generic/006 generic/007 generic/011 generic/013 generic/014 generic/015 generic/023 generic/024 generic/025 generic/028 generic/029 generic/030 generic/035 generic/053 generic/067 generic/069 generic/071 generic/074 generic/075 generic/078 generic/080 generic/083 generic/084 generic/086 generic/087 generic/088 generic/089 generic/095 generic/098 generic/100 generic/102 generic/105 generic/109 generic/112 generic/120 generic/123 generic/124 generic/126 generic/127 generic/128 generic/129 generic/131 generic/132 generic/141 generic/169 generic/184 generic/192 generic/193 generic/204 generic/213 generic/215 generic/221 generic/224 generic/228 generic/236 generic/237 generic/241 generic/245 generic/246 generic/247 generic/248 generic/249 generic/256 generic/257 generic/258 generic/274 generic/275 generic/285 generic/286 generic/294 generic/306 generic/307 generic/308 generic/309 generic/310 generic/312 generic/313 !
generic/314 generic/315 generic/319 generic/320
Failures: generic/080
END TEST: tmpfs Tue Feb 9 21:03:53 EST 2016
Re: [PATCH 01/12] check: avoid error messages of tests/$FS does not exist
In reply to Theodore Ts'oQuoted 5 lines · Theodore Ts'o
There are no tmpfs specific tests, so tests/tmpfs does not exist. Avoid print an error message caused by trying to read the file tests/tmpfs/group (for example).
Signed-off-by Theodore Ts'o <[email protected]>
Where does this error message get emitted? I would have expected lots of people to notice this (e.g. NFS, CIFS, ext2, ext3, gfs2) if this was causing some kind of problem long before this...
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 08/12] xfstests: fix generic/312 on tmpfs, ignore /proc/partitions
In reply to Theodore Ts'oQuoted 19 lines · Theodore Ts'o
From: Hugh Dickins <[email protected]>
312 avoid reading
/proc/partitionsfor tmpfs, just assume enough space.Signed-off-by Hugh Dickins <[email protected]>Signed-off-by Theodore Ts'o <[email protected]>--- tests/generic/312 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)tests/generic/312 +0
-1@@ -51,12 +51,13 @@ _require_scratch # 5G in byte fssize=$((2**30 * 5)) -required_blocks=$(($fssize / 1024))
tests/generic/312 _require_scratch · line 60
Quoted 10 lines
tests/generic/312 +6
-3-dev_blocks=$(grep -w $(_short_dev $SCRATCH_DEV) /proc/partitions | $AWK_PROG '{print $3}') -if [ $required_blocks -gt $dev_blocks ];then - _notrun "this test requires \$SCRATCH_DEV has ${fssize}B space" +if [ "$FSTYP" != "tmpfs" ]; then + required_blocks=$(($fssize / 1024)) + dev_blocks=$(grep -w $(_short_dev $SCRATCH_DEV) /proc/partitions | $AWK_PROG '{print $3}') + if [ $required_blocks -gt $dev_blocks ];then + _notrun "this test requires \$SCRATCH_DEV has ${fssize}B space" + fi fi
_scratch_mkfs_scratch_mount_require_fs_space $SCRATCH_MNT $((fssize / 1024))_scratch_unmount_scratch_mkfs_sized $fssize
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 10/12] generic: disable generic/027 for tmpfs
In reply to Theodore Ts'oQuoted 6 lines · Theodore Ts'o
The generic/027 test creates a large number of 1k files until the file creation fails. On other file systems there will be a large number zero length files because the block allocation has failed, but there are still inodes available, and so the file creation loop runs until the file system runs out of inodes.
Quoted 8 lines
With tmpfs, we can limit the size of the file system, which limits the block allocation, but there is no limit to the number of inodes that can be created until
kmalloc()fails --- or the OOM killer kills the test. So this causes this test to run for a long, long time, and in some cases the test or the test runner will get OOM killed instead. We have other ENOSPC tests, so given that tmpfs is just so different from all other file systems, it's simpler just to disable this test for tmpfs than to try to make it work.
This sounds like a bug in tmpfs and a potential user level DOS vector, too. Hence I dont think not running the test is the right thing to do here - tmpfs should be handling this gracefully by applying sane resource limits.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 02/12] common: _scratch_mkfs_sized() for tmpfs
In reply to Theodore Ts'oQuoted 26 lines · Theodore Ts'o
From: Hugh Dickins <[email protected]>
_scratch_mkfs_sized()avoid blockdev and updateMOUNT_OPTIONSwith required size on tmpfs, so those tests using it can now run.Signed-off-by Hugh Dickins <[email protected]>Signed-off-by Junho Ryu <[email protected]>Signed-off-by Theodore Ts'o <[email protected]>--- common/rc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)common/rc +1
-1@@ -813,7 +813,7 @@ _scratch_mkfs_sized() blocks=`expr $fssize / $blocksize` - if [ "$HOSTOS" == "Linux" ]; then + if [ "$HOSTOS" == "Linux" -a -b "$SCRATCH_DEV" ]; then devsize=`blockdev --getsize64 $SCRATCH_DEV` [ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small" fi
common/rc _scratch_mkfs_sized() · line 853
Quoted 5 lines
common/rc +2
-0@@ -849,6 +849,9 @@ _scratch_mkfs_sized() sector_size=`blockdev --getss $SCRATCH_DEV` $MKFS_F2FS_PROG $MKFS_OPTIONS $SCRATCH_DEV `expr $fssize / $sector_size` ;; + tmpfs) + export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS"
So what happens when the test asks for 10GB of device space, and you only have 4GB of RAM?
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 05/12] xfstests: do not unmount tmpfs during remount
In reply to Theodore Ts'oQuoted 9 lines · Theodore Ts'o
From: Junho Ryu <[email protected]>
Several tests unmount then re-mount the scratch filesystem, to check that the content is unchanged; but unmounting a tmpfs is designed to lose its content, which causes such tests to fail unnecessarily.
Signed-off-by Hugh Dickins <[email protected]>Signed-off-by Junho Ryu <[email protected]>Signed-off-by Theodore Ts'o <[email protected]>
....
Quoted 8 lines
_scratch_remount()
{common/rc +4
-2- _scratch_unmount - _scratch_mount + case $FSTYP in + tmpfs) + OPTS="$@" + if test -n "$OPTS"; then
common/rc _scratch_unmount() · line 347
Quoted 10 lines
common/rc +9
-0+ OPTS=$(echo $OPTS | sed -e 's/-o /-o remount,/') + mount $OPTS $SCRATCH_MNT + fi + ;; + *) + _scratch_unmount + _scratch_mount "$@" + ;; + esac }
If really don't like the different definitions of "remount" being used here, especially now that new parameters are being passed in. i.e.
tests/generic/003 _compare_stat_times NNN "$file1_stat_after_first_access" \ · line 111
Quoted 9 lines
tests/generic/003 +1
-2@@ -108,8 +108,7 @@ _compare_stat_times NNN "$file1_stat_after_first_access" \ "$file1_stat_after_second_access" "after accessing file1 second time" # Remounting with nodiratime option -_scratch_unmount -_scratch_mount "-o nodiratime" +_scratch_remount "-o nodiratime"
This makes me go "no, that can't work, nodiratime is not an option that we allow on remount."
So, at minimum, the name of the helper needs to get changed so that it doesn't imply that a "-o remount" with new options is being done...
Quoted 6 lines
tests/generic/003 +0
-5_require_scratch -_scratch_mkfs >/dev/null 2>&1 - -_umount_mount() -{ - CWD=`pwd`
tests/generic/003 _compare_stat_times NNN "$file1_stat_after_first_access" \
Quoted 10 lines
tests/generic/003 +2
-8- cd / - # pipe error into /dev/null, in case not mounted (after _require_scratch) - _scratch_unmount 2>/dev/null - _scratch_mount - cd "$CWD" -} - -_umount_mount +_scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed" +_scratch_mount > /dev/null 2>&1 || _fail "mount failed"
Please don't add _fail to mkfs/mount like this, especially where the test doesn't already have them.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 11/12] xfstests: add executable permission to tests
In reply to Theodore Ts'oQuoted 4 lines · Theodore Ts'o
From: Hugh Dickins <[email protected]>
Signed-off-by Hugh Dickins <[email protected]>Signed-off-by Theodore Ts'o <[email protected]>
I noticed that there're more tests have the wrong mode
tests/xfs/140
tests/btrfs/104
tests/btrfs/026
tests/btrfs/114
tests/generic/061
tests/generic/103
tests/generic/063
tests/generic/094
tests/generic/058
tests/generic/060
tests/generic/092
I think they can be updated in one patch.
Thanks,
Eryu
Quoted 30 lines
--- tests/generic/058 | 0 tests/generic/060 | 0 tests/generic/061 | 0 tests/generic/063 | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tests/generic/058 mode change 100644 => 100755 tests/generic/060 mode change 100644 => 100755 tests/generic/061 mode change 100644 => 100755 tests/generic/063tests/generic/058 +0
-0tests/generic/060 +0
-0tests/generic/061 +0
-0tests/generic/063 +0
-0Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 09/12] xfstests: generic/079 requires chattr, not xattrs
In reply to Theodore Ts'oQuoted 13 lines · Theodore Ts'o
From: Hugh Dickins <[email protected]>
Signed-off-by Hugh Dickins <[email protected]>Signed-off-by Theodore Ts'o <[email protected]>--- tests/generic/079 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/generic/079 +0
-0
tests/generic/079 _cleanup() · line 51
Quoted 5 lines
tests/generic/079 +1
-1@@ -48,7 +48,7 @@ _cleanup() _supported_fs generic _supported_os Linux -_require_attrs +_require_chattr
I don't see _require_chattr in any of the common files, did I miss anything?
Thanks,
Eryu
Quoted 10 lines
tests/generic/079 +0
-0_require_scratch [ -x $timmutable ] || _notrun "t_immutable was not built for this platform"Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 04/12] generic: add _require_odirect to three more tests
In reply to Theodore Ts'oQuoted 30 lines · Theodore Ts'o
From: Hugh Dickins <[email protected]>
generic/113, generic/125, generic/214 each use
O_DIRECTat some stage in their tests, so checkO_DIRECTsupport before running them.Signed-off-by Hugh Dickins <[email protected]>Signed-off-by Theodore Ts'o <[email protected]>--- tests/generic/113 | 1 + tests/generic/125 | 1 + tests/generic/214 | 1 + 3 files changed, 3 insertions(+)tests/generic/113 +1
-0@@ -77,6 +77,7 @@ _do_test() _supported_fs generic _supported_os Linux _require_test +_require_odirect [ -x $here/ltp/aio-stress ] || _notrun "aio-stress not built for this platform"tests/generic/125 +0
-0
tests/generic/125 _supported_os Linux · line 44
Quoted 4 lines
tests/generic/125 +1
-0@@ -41,6 +41,7 @@ _supported_os Linux _require_test _require_user +_require_odirect
generic/125 only runs "./src/ftrunc" and I don't see where O_DIRECT is being used, did I miss anything?
Thanks,
Eryu
Quoted 22 lines
tests/generic/125 +0
-0TESTDIR=$TEST_DIR/ftrunc TESTFILE=$TESTDIR/ftrunc.tmptests/generic/214 +1
-0@@ -55,6 +55,7 @@ rm -f $seqres.full rm -f $TEST_DIR/ouch* _require_xfs_io_command "falloc" +_require_odirect # Ok, off we go.Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 01/12] check: avoid error messages of tests/$FS does not exist
In reply to Dave ChinnerQuoted 10 lines · Dave Chinner
Quoted 5 lines · Theodore Ts'o
There are no tmpfs specific tests, so tests/tmpfs does not exist. Avoid print an error message caused by trying to read the file tests/tmpfs/group (for example).
Signed-off-by Theodore Ts'o <[email protected]>Where does this error message get emitted? I would have expected lots of people to notice this (e.g. NFS, CIFS, ext2, ext3, gfs2) if this was causing some kind of problem long before this...
It doesn't really cause a problem; it's more of a cosmetic issue, in that it prints a harmless/annoying error message during the test startup. It shows up if you specify a group, e.g. "check -g quick":
BEGIN TEST tmpfs: tmpfs Wed Feb 10 10:31:09 EST 2016
DEVICE: test:/tmp
MK2FS OPTIONS:
MOUNT OPTIONS: -o block_validity
./check: line 96: tests/tmpfs/group: No such file or directory
FSTYP -- tmpfs PLATFORM -- Linux/i686 kvm-xfstests 4.5.0-rc2ext4-00002-g6df2762 MKFS_OPTIONS -- test:/scratch
MOUNT_OPTIONS -- -o size=1G test:/scratch /test/scratch
generic/001 [10:31:10][ 5.811742] run fstests generic/001
...
Cheers,
- Ted
Re: [PATCH 10/12] generic: disable generic/027 for tmpfs
In reply to Dave ChinnerQuoted 9 lines · Dave Chinner
Quoted 8 lines
With tmpfs, we can limit the size of the file system, which limits the block allocation, but there is no limit to the number of inodes that can be created until
kmalloc()fails --- or the OOM killer kills the test. So this causes this test to run for a long, long time, and in some cases the test or the test runner will get OOM killed instead. We have other ENOSPC tests, so given that tmpfs is just so different from all other file systems, it's simpler just to disable this test for tmpfs than to try to make it work.
Quoted 4 lines
This sounds like a bug in tmpfs and a potential user level DOS vector, too. Hence I dont think not running the test is the right thing to do here - tmpfs should be handling this gracefully by applying sane resource limits.
Well, it's not really that interesting of a DOS vector since if the goal is to use up all available memory, there are other ways to do it that are much more efficient. If you are using a memory cgroup, the kmalloc does eventually fail and so the O_CREAT open(2) call will return ENOMEM --- but it can take 20+ hours with a 8G memory container. Without a memory cgroup in general the test runner gets OOM killed first, but a much better DOS vector is to open one too many tabs in Chrome, at which point your machine thrashes to death and the X server goes unresponsive (and this is why many people have started running Chrome inside a memory container).
OTOH, the fact that tmpfs doesn't have a inode limits is a bit weird. What about having tmpfs enforce a per-mount "maxinodes" restriction which by default is "maxsize / 1k", and which can be overriden using a maxinodes mount option? Does that sound sane to you?
Or we could charge a minimum 512 bytes per inode against the size, since between the kernel data structures and the file name, it's not like a zero-length tmpfs file is free.
- Ted
Re: [PATCH 02/12] common: _scratch_mkfs_sized() for tmpfs
In reply to Dave ChinnerQuoted 5 lines · Dave Chinner
common/rc _scratch_mkfs_sized() · line 853
Quoted 2 lines
common/rc +2
-0+ tmpfs) + export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS"So what happens when the test asks for 10GB of device space, and you only have 4GB of RAM?
The largest amount of storage space requested by shared/generic tests via _scratch_mkfs_sized is 2G, and that's from generic/27[345].
We currently could run into problems today if the storage device only had 3G of space, and some test, such as f2fs/001, called _scratch_mkfs_sized requesting 4G of space. We currently aren't checking error returns from the mkfs command; we just assume that it will succeed.
Because of the someone interesting behavior of tmpfs assuming inode space is free, we already have problems where even with 8G of memory, generic/269 and generic/273 will result in the test getting OOM killed, and if you use less than 4G, there are a more tests that end up getting OOM killed as a result.
So I think it would be fair to simply document that if you are testing tmpfs, you need a VM or or a memory container with at least 8G of memory. If we start limiting the number of inodes in a tmpfs mount, we could probably bring that requirement down to 4G, which is certainly fair. We do document minimum requirements for the size of
the TEST_DEV and SCRATCH_DEV, don't we? (Minimum requirements
certainly do exist in practice, in any case.)
Cheers,
- Ted
Re: [PATCH 05/12] xfstests: do not unmount tmpfs during remount
In reply to Dave ChinnerQuoted 7 lines · Dave Chinner
tests/generic/003 _compare_stat_times NNN "$file1_stat_after_first_access" \ · line 111
Quoted 4 lines
# Remounting with nodiratime option
tests/generic/003 +1
-2-_scratch_unmount -_scratch_mount "-o nodiratime" +_scratch_remount "-o nodiratime"This makes me go "no, that can't work, nodiratime is not an option that we allow on remount."
Hmm, yes, we're not consistent here. xfs doesn't allow nodiratime on remounts. ext4 allows nodiratime on remount, but not diratime, so there's no way to clear nodiratime once its set. tmpfs allows diratime and nodiratime on remount.
I wonder if it's worth it make things more consistent across the various file systems. What do you think?
Quoted 3 lines
So, at minimum, the name of the helper needs to get changed so that it doesn't imply that a "-o remount" with new options is being done...
Hmm, how about having two helper functions: _scratch_remount that doesn't take any arguments, and a _scratch_change_mount_opts which does?
Quoted 6 lines
tests/generic/135 _supported_os Linux IRIX · line 45
Quoted 3 lines
tests/generic/135 +2
-1-_umount_mount +_scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed" +_scratch_mount > /dev/null 2>&1 || _fail "mount failed"Please don't add
_failto mkfs/mount like this, especially where the test doesn't already have them.
Could you say more about why? We do have tests that do use _fail if the mkfs or mount fails. Should we be changing them to remove it? But if we do that, and the mount fails for some reason, then won't things stagger on and perhaps make life harder to debug.
Cheers,
- Ted
Re: [PATCH 09/12] xfstests: generic/079 requires chattr, not xattrs
In reply to Eryu GuanQuoted 17 lines · Eryu Guan
Quoted 16 lines · Theodore Ts'o
From: Hugh Dickins <[email protected]>
Signed-off-by Hugh Dickins <[email protected]>Signed-off-by Theodore Ts'o <[email protected]>--- tests/generic/079 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/generic/079 +0
-0@@ -48,7 +48,7 @@ _cleanup() _supported_fs generic _supported_os Linux
Quoted 5 lines
tests/generic/079 _cleanup() · line 51
Quoted 2 lines
tests/generic/079 +1
-1-_require_attrs +_require_chattrI don't see
_require_chattrin any of the common files, did I miss anything?
Oops, I forgot to pull that into the patch. Thanks for catching this!
- Ted
Re: [PATCH 04/12] generic: add _require_odirect to three more tests
In reply to Eryu GuanQuoted 3 lines · Eryu Guan
generic/125 only runs "./src/ftrunc" and I don't see where
O_DIRECTis being used, did I miss anything?
generic/125 also calls "src/trunc", which does use O_DIRECT.
(Hmm, and it assumes '.' is in the test's path, which I don't think is a safe thing to do.)
- Ted
Re: [PATCH 01/12] check: avoid error messages of tests/$FS does not exist
In reply to Theodore Ts'oQuoted 3 lines · Theodore Ts'o
It doesn't really cause a problem; it's more of a cosmetic issue, in that it prints a harmless/annoying error message during the test startup. It shows up if you specify a group, e.g. "check -g quick":
I found this annoying when testing nfs, and it's been on my todo list for a while to fix it. Never high enough to actually do it, but I'd love to see the fix merged.
Re: [PATCH 05/12] xfstests: do not unmount tmpfs during remount
In reply to Theodore Ts'oHow about this?
- Ted
Quoted 1 line
From
e03fcd72962fc29e198173662635d4fa10779128Mon Sep 17 00:00:00 2001
From: Junho Ryu <[email protected]>
Date: Wed, 18 Dec 2013 10:16:01 -0800
Subject: [PATCH] xfstests: do not unmount tmpfs during remount
Several tests unmount then re-mount the scratch filesystem, to check that the content is unchanged; but unmounting a tmpfs is designed to lose its content, which causes such tests to fail unnecessarily.
--- common/rc | 23 +++++++++++++++++++++++ tests/generic/003 | 12 ++++-------- tests/generic/135 | 17 +++-------------- tests/generic/169 | 20 ++++++-------------- tests/generic/169.out | 6 ++---- tests/generic/192 | 3 +-- tests/generic/226 | 3 +-- tests/generic/258 | 3 +-- tests/generic/306 | 3 +-- tests/generic/317 | 3 +-- tests/generic/318 | 3 +-- 11 files changed, 44 insertions(+), 52 deletions(-)
common/rc +23 -0
@@ -331,10 +331,30 @@ _scratch_unmount() _scratch_remount() { + if [ "$FSTYP" = tmpfs ]; then + return + fi _scratch_unmount _scratch_mount } +_scratch_change_mount_opts() +{ + case $FSTYP in + tmpfs) + OPTS="$@" + if test -n "$OPTS"; then + OPTS=$(echo $OPTS | sed -e 's/-o /-o remount,/') + mount $OPTS $SCRATCH_MNT + fi + ;; + *) + _scratch_unmount + _scratch_mount "$@" + ;; + esac +} + _test_mount() { if [ "$FSTYP" == "overlay" ]; then
@@ -356,6 +376,9 @@ _test_unmount() _test_remount() { + if [ "$FSTYP" = tmpfs ]; then + return + fi _test_unmount _test_mount }
tests/generic/003 +4 -8
@@ -108,8 +108,7 @@ _compare_stat_times NNN "$file1_stat_after_first_access" \ "$file1_stat_after_second_access" "after accessing file1 second time" # Remounting with nodiratime option -_scratch_unmount -_scratch_mount "-o nodiratime" +_scratch_change_mount_opts "-o nodiratime" file1_stat_after_remount=`_stat $TPATH/dir1/file1` _compare_stat_times NNN "$file1_stat_after_second_access" \ "$file1_stat_after_remount" "for file1 after remount"
@@ -135,8 +134,7 @@ _compare_stat_times NNN "$dir2_stat_after_file_creation" \ "$dir2_stat_after_file_access" "for dir2 after file access" # Remounting with noatime option, creating a file and accessing it -_scratch_unmount -_scratch_mount "-o noatime" +_scratch_change_mount_opts "-o noatime" echo "ccc" > $TPATH/dir2/file3 file3_stat_before_first_access=`_stat $TPATH/dir2/file3` sleep 1
@@ -160,8 +158,7 @@ _compare_stat_times NNY "$file1_stat_after_modify" \ # Remounting with strictatime option and # accessing a previously created file twice -_scratch_unmount -_scratch_mount "-o strictatime" +_scratch_change_mount_opts "-o strictatime" cat $TPATH/dir2/file3 > /dev/null file3_stat_after_second_access=`_stat $TPATH/dir2/file3` _compare_stat_times YNN "$file3_stat_after_first_access" \
@@ -194,8 +191,7 @@ fi sleep 1 dir2_stat_before_ro_mount=`_stat $TPATH/dir2` file3_stat_before_ro_mount=`_stat $TPATH/dir2/file3` -_scratch_unmount -_scratch_mount "-o ro,strictatime" +_scratch_change_mount_opts "-o ro,strictatime" ls $TPATH/dir2 > /dev/null cat $TPATH/dir2/file3 > /dev/null dir2_stat_after_ro_mount=`_stat $TPATH/dir2`
tests/generic/135 +3 -14
@@ -41,19 +41,8 @@ _supported_os Linux IRIX _require_odirect _require_scratch -_scratch_mkfs >/dev/null 2>&1 - -_umount_mount() -{ - CWD=`pwd` - cd / - # pipe error into /dev/null, in case not mounted (after _require_scratch) - _scratch_unmount 2>/dev/null - _scratch_mount - cd "$CWD" -} - -_umount_mount +_scratch_mkfs >/dev/null +_scratch_mount cd $SCRATCH_MNT
@@ -71,7 +60,7 @@ $XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x78 0 4k' trunc_file > /dev/null $XFS_IO_PROG -f -c 'truncate 2k' trunc_file > /dev/null $XFS_IO_PROG -c 'pwrite 1k 0 1k' trunc_file > /dev/null -_umount_mount +_scratch_remount # check file size and contents od -Ad -x async_file
tests/generic/169 +6 -14
@@ -73,13 +73,9 @@ $XFS_IO_PROG -a -c "pwrite 0 5k" -c "fsync" \ $SCRATCH_MNT/testfile \ | _show_wrote_and_stat_only -echo "# unmounting scratch" -_scratch_unmount>>$seqres.full 2>&1 \ - || _fail "unmount failed" - -echo "# mounting scratch" -_scratch_mount >>$seqres.full 2>&1 \ - || _fail "mount failed: $MOUNT_OPTIONS" +echo "# remounting scratch" +_scratch_remount >>$seqres.full 2>&1 \ + || _fail "remount failed: $MOUNT_OPTIONS" echo "# stating file to confirm correct size" $XFS_IO_PROG -r -c "stat" $SCRATCH_MNT/testfile \
@@ -90,13 +86,9 @@ $XFS_IO_PROG -f -c "pwrite 0 5" -c s -c "pwrite 5 5" \ -c "stat" $SCRATCH_MNT/nextfile \ | _show_wrote_and_stat_only -echo "# unmounting scratch" -_scratch_unmount>>$seqres.full 2>&1 \ - || _fail "unmount failed" - -echo "# mounting scratch" -_scratch_mount >>$seqres.full 2>&1 \ - || _fail "mount failed: $MOUNT_OPTIONS" +echo "# remounting scratch" +_scratch_remount >>$seqres.full 2>&1 \ + || _fail "remount failed: $MOUNT_OPTIONS" echo "# stating file to confirm correct size" $XFS_IO_PROG -r -c "stat" $SCRATCH_MNT/nextfile \
tests/generic/169.out +2 -4
@@ -5,15 +5,13 @@ wrote 5120/5120 bytes at offset 0 wrote 5120/5120 bytes at offset 5120 wrote 5120/5120 bytes at offset 10240 stat.size = 15360 -# unmounting scratch -# mounting scratch +# remounting scratch # stating file to confirm correct size stat.size = 15360 # appending 10 bytes to new file, sync at 5 bytes wrote 5/5 bytes at offset 0 wrote 5/5 bytes at offset 5 stat.size = 10 -# unmounting scratch -# mounting scratch +# remounting scratch # stating file to confirm correct size stat.size = 10
tests/generic/192 +1 -2
@@ -78,8 +78,7 @@ cat $testfile time2=`_access_time $testfile | tee -a $seqres.full` cd / -_test_unmount -_test_mount +_test_remount time3=`_access_time $testfile | tee -a $seqres.full` delta1=`expr $time2 - $time1`
tests/generic/226 +1 -2
@@ -61,8 +61,7 @@ for I in `seq 1 $loops`; do done echo -_scratch_unmount -_scratch_mount +_scratch_remount echo "--> $loops direct 64m writes in a loop" for I in `seq 1 $loops`; do
tests/generic/258 +1 -2
@@ -62,8 +62,7 @@ fi # unmount, remount, and check the timestamp echo "Remounting to flush cache" -_test_unmount -_test_mount +_test_remount # Should yield -315593940 (prior to epoch) echo "Testing for negative seconds since epoch"
tests/generic/306 +1 -2
@@ -67,8 +67,7 @@ touch $BINDFILE || _fail "Could not create bind mount file" touch $TARGET || _fail "Could not create symlink target" ln -s $TARGET $SYMLINK -_scratch_unmount || _fail "Could not unmount scratch device" -_scratch_mount -o ro || _fail "Could not mount scratch readonly" +_scratch_change_mount_opts -o ro || _fail "Could not remount scratch readonly" # We should be able to read & write to/from these devices even on an RO fs echo "== try to create new file"
tests/generic/317 +1 -2
@@ -96,8 +96,7 @@ echo "" echo "*** Remounting ***" echo "" sync -_scratch_unmount >>$seqres.full 2>&1 -_scratch_mount >>$seqres.full 2>&1 || _fail "mount failed" +_scratch_remount >>$seqres.full 2>&1 || _fail "remount failed" _print_numeric_uid
tests/generic/318 +1 -2
@@ -109,8 +109,7 @@ _print_getfacls echo "*** Remounting ***" echo "" sync -_scratch_unmount >>$seqres.full 2>&1 -_scratch_mount >>$seqres.full 2>&1 || _fail "mount failed" +_scratch_remount >>$seqres.full 2>&1 || _fail "remount failed" _print_getfacls
Signature · 1 line
2.5.0
Re: [PATCH 01/12] check: avoid error messages of tests/$FS does not exist
In reply to Theodore Ts'oQuoted 21 lines · Theodore Ts'o
Quoted 10 lines · Dave Chinner
Quoted 5 lines · Theodore Ts'o
There are no tmpfs specific tests, so tests/tmpfs does not exist. Avoid print an error message caused by trying to read the file tests/tmpfs/group (for example).
Signed-off-by Theodore Ts'o <[email protected]>Where does this error message get emitted? I would have expected lots of people to notice this (e.g. NFS, CIFS, ext2, ext3, gfs2) if this was causing some kind of problem long before this...
It doesn't really cause a problem; it's more of a cosmetic issue, in that it prints a harmless/annoying error message during the test startup. It shows up if you specify a group, e.g. "check -g quick":
BEGIN TEST tmpfs: tmpfs Wed Feb 10 10:31:09 EST 2016
DEVICE: test:/tmp
MK2FS OPTIONS:
MOUNT OPTIONS: -oblock_validity
./check: line 96: tests/tmpfs/group: No such file or directory
Quoted 6 lines
FSTYP -- tmpfs PLATFORM -- Linux/i686 kvm-xfstests 4.5.0-rc2ext4-00002-g6df2762 MKFS_OPTIONS -- test:/scratch
MOUNT_OPTIONS-- -o size=1G test:/scratch /test/scratchgeneric/001 [10:31:10][ 5.811742] run fstests generic/001
Can you please rewrite the commit message to include this?
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 02/12] common: _scratch_mkfs_sized() for tmpfs
In reply to Theodore Ts'oQuoted 9 lines · Theodore Ts'o
Quoted 5 lines · Dave Chinner
common/rc _scratch_mkfs_sized() · line 853
Quoted 2 lines
common/rc +2
-0+ tmpfs) + export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS"So what happens when the test asks for 10GB of device space, and you only have 4GB of RAM?
The largest amount of storage space requested by shared/generic tests via
_scratch_mkfs_sizedis 2G, and that's from generic/27[345].
Sure, but that doesn't doesn't invalidate my question.
I run xfstests on machines with 1GB RAM, so those tests you list above are going to have problems with tmpfs, yes?
Quoted 5 lines
We currently could run into problems today if the storage device only had 3G of space, and some test, such as f2fs/001, called
_scratch_mkfs_sizedrequesting 4G of space. We currently aren't checking error returns from the mkfs command; we just assume that it will succeed.
That would be a test bug. We have a general rule of thumb that test/scratch devices are typically a couple of GB in size, so if the test needs less space than that it doesn't need to check. If the test needs more than 1-2GB of space, then it needs to call _require_fs_space to abort the test if the device is too small. Hence we end up with tests being not run with:
generic/312 [not run] this test requires $SCRATCH_DEV has 5368709120B space
This needs to work for tmpfs, too, so that we don't run tests that will overcommit RAM on machines with limited memory.
Quoted 5 lines
Because of the someone interesting behavior of tmpfs assuming inode space is free, we already have problems where even with 8G of memory, generic/269 and generic/273 will result in the test getting OOM killed, and if you use less than 4G, there are a more tests that end up getting OOM killed as a result.
As I said, this is a tmpfs bug that needs fixing, not working around in xfstests. If tmpfs is limited to 512MB or 1GB of space, then having it be able to consume multiple times it's requested size in memory is simply wrong.
Quoted 6 lines
So I think it would be fair to simply document that if you are testing tmpfs, you need a VM or or a memory container with at least 8G of memory. If we start limiting the number of inodes in a tmpfs mount, we could probably bring that requirement down to 4G, which is certainly fair. We do document minimum requirements for the size of the
TEST_DEVandSCRATCH_DEV, don't we?
No, not that I know of.
Quoted 2 lines
(Minimum
requirements certainly do exist in practice, in any case.)
See above.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 04/12] generic: add _require_odirect to three more tests
In reply to Theodore Ts'oQuoted 9 lines · Theodore Ts'o
Quoted 3 lines · Eryu Guan
generic/125 only runs "./src/ftrunc" and I don't see where
O_DIRECTis being used, did I miss anything?generic/125 also calls "src/trunc", which does use
O_DIRECT.(Hmm, and it assumes '.' is in the test's path, which I don't think is a safe thing to do.)
Perhaps one should question whether generic/125 is actually testing anything useful in the first place.
i.e. it's writing 16k, then truncating it back to 1000 bytes, then reading it with direct IO for 60s to see if it returns the correct data for that entire time.
What, exactly, is going to cause that test to fail?
Keep in mind this was ported from a CXFS test, where the metadata server did the truncation operation (including the data zeroing), but the reads are being done from the client. i.e. it was designed to test whether a remote machine is doing a truncate correctly on a access shared disk.
IMO, I think we just remove the test, src/trunc.c and src/ftrunc.c because it's 60s of testing that doesn't actually provide any value to us.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 05/12] xfstests: do not unmount tmpfs during remount
In reply to Theodore Ts'oQuoted 9 lines · Theodore Ts'o
Quoted 7 lines · Dave Chinner
tests/generic/003 _compare_stat_times NNN "$file1_stat_after_first_access" \ · line 111
Quoted 4 lines
# Remounting with nodiratime option
tests/generic/003 +1
-2-_scratch_unmount -_scratch_mount "-o nodiratime" +_scratch_remount "-o nodiratime"This makes me go "no, that can't work, nodiratime is not an option that we allow on remount."
Quoted 7 lines
Hmm, yes, we're not consistent here. xfs doesn't allow nodiratime on remounts. ext4 allows nodiratime on remount, but not diratime, so there's no way to clear nodiratime once its set. tmpfs allows diratime and nodiratime on remount.
I wonder if it's worth it make things more consistent across the various file systems. What do you think?
Different problem, care factor approaching zero right now. :/
Talk to Eric - he's futzing with this stuff on XFS right now.
Quoted 7 lines
Quoted 3 lines
So, at minimum, the name of the helper needs to get changed so that it doesn't imply that a "-o remount" with new options is being done...
Hmm, how about having two helper functions:
_scratch_remountthat doesn't take any arguments, and a_scratch_change_mount_optswhich does?
No, it's not really the options that are the problem here. The problem is -o remount vs unmount/mount and what the test is actually expecting.
I'd say "_scratch_remount" should do "-o remount" unconditionally (least surprise) and the current _scratch_remount should be changed to something like _scratch_cycle_mount(). That way both can take options, but it's clear they do different things. tmpfs can simply implement them the same way.
Quoted 9 lines
Quoted 6 lines
tests/generic/135 _supported_os Linux IRIX · line 45
Quoted 3 lines
tests/generic/135 +2
-1-_umount_mount +_scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed" +_scratch_mount > /dev/null 2>&1 || _fail "mount failed"Please don't add
_failto mkfs/mount like this, especially where the test doesn't already have them.Could you say more about why? We do have tests that do use
_failif the mkfs or mount fails. Should we be changing them to remove it?
Because, in general, scratch_mkfs should not ever fail, and nor should a mounting the scratch device. If they do fail, something has already gone wrong...
Quoted 2 lines
But if we do that, and the mount fails for some reason, then won't things stagger on and perhaps make life harder to debug.
Yes, but we don't care that they make lots of noise or that they stagger on, because that staggering on can exercise failure and other unexpected paths that wouldn't otherwise get exercised. I've lost count of the number of times that I've had a stuck process prevent an unmount and a subsequent test has tripped over and uncovered a previously unknown bug because we allowed mkfs and mount to fail....
As for debugging - you always have to go back to the first failure you see in xfstests and work from there, so the subsequent noise of other tests failing can simply be ignored. Yes, it can make it a little harder to identify the first failure, but it only takes a few seconds looking at log files to identify that these functions have failed...
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 10/12] generic: disable generic/027 for tmpfs
In reply to Theodore Ts'oQuoted 10 lines · Theodore Ts'o
Quoted 9 lines · Dave Chinner
Quoted 8 lines
With tmpfs, we can limit the size of the file system, which limits the block allocation, but there is no limit to the number of inodes that can be created until
kmalloc()fails --- or the OOM killer kills the test. So this causes this test to run for a long, long time, and in some cases the test or the test runner will get OOM killed instead. We have other ENOSPC tests, so given that tmpfs is just so different from all other file systems, it's simpler just to disable this test for tmpfs than to try to make it work.
Quoted 8 lines
Quoted 4 lines
This sounds like a bug in tmpfs and a potential user level DOS vector, too. Hence I dont think not running the test is the right thing to do here - tmpfs should be handling this gracefully by applying sane resource limits.
Well, it's not really that interesting of a DOS vector since if the goal is to use up all available memory, there are other ways to do it that are much more efficient.
Of course, but that doesn't mean the behaviour is valid. If we are relying on the OOM killer to kill the right thing or require memcgs to prevent trivial OOM killer invocations, then we've got a problem that needs fixing.
....
Quoted 8 lines
OTOH, the fact that tmpfs doesn't have a inode limits is a bit weird. What about having tmpfs enforce a per-mount "maxinodes" restriction which by default is "maxsize / 1k", and which can be overriden using a maxinodes mount option? Does that sound sane to you?
Or we could charge a minimum 512 bytes per inode against the size, since between the kernel data structures and the file name, it's not like a zero-length tmpfs file is free.
I'd suggest simply charging sizeof(struct shmem_inode_info) against the space usage when inode allocation is requested.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 01/12] check: avoid error messages of tests/$FS does not exist
In reply to Christoph HellwigQuoted 8 lines · Christoph Hellwig
Quoted 3 lines · Theodore Ts'o
It doesn't really cause a problem; it's more of a cosmetic issue, in that it prints a harmless/annoying error message during the test startup. It shows up if you specify a group, e.g. "check -g quick":
I found this annoying when testing nfs, and it's been on my todo list for a while to fix it. Never high enough to actually do it, but I'd love to see the fix merged.
Yeah, it triggered my inner OCD, but if it weren't for the fact that I was making a bunch of other tmpfs changes it probably wouldn't have risen to the top of my list either.
- Ted
Re: [PATCH 04/12] generic: add _require_odirect to three more tests
In reply to Dave ChinnerQuoted 5 lines · Dave Chinner
Keep in mind this was ported from a CXFS test, where the metadata server did the truncation operation (including the data zeroing), but the reads are being done from the client. i.e. it was designed to test whether a remote machine is doing a truncate correctly on a access shared disk.
Maybe the Ceph folks would care? But I'm happy to replace this with a test that just nukes generic/125.
- Ted
Re: [PATCH 05/12] xfstests: do not unmount tmpfs during remount
In reply to Dave ChinnerQuoted 9 lines · Dave Chinner
No, it's not really the options that are the problem here. The problem is -o remount vs unmount/mount and what the test is actually expecting.
I'd say "
_scratch_remount" should do "-o remount" unconditionally (least surprise) and the current_scratch_remountshould be changed to something like_scratch_cycle_mount(). That way both can take options, but it's clear they do different things. tmpfs can simply implement them the same way.
Well, I can do that, but it's going to be a huge patch --- the vast majority of the calls to _scratch_remount in the tree (over 100) would have to be changed to _scratch_cycle_mount, because they are just doing a _scratch_umount / _scratch_mount without taking any arguments to change the mount option.
It is this patch that adds the calls that is using -o remount to change mount options for generic/003 and generic/306 and tmpfs.
This is why I suggested adding _scratch_change_mount_opts because it changes the smallest number of things, and keeps _scratch_mount to have the same semantic value.
But if you want me to sweep through the entire tree changing _scratch_remount to _scratch_cycle_mount, I suppose I can do that. It's not going to be a small patch, though......
- Ted
Re: [PATCH 01/12] check: avoid error messages of tests/$FS does not exist
In reply to Dave ChinnerQuoted 27 lines · Dave Chinner
Quoted 26 lines · Theodore Ts'o
Quoted 10 lines · Dave Chinner
Quoted 5 lines · Theodore Ts'o
There are no tmpfs specific tests, so tests/tmpfs does not exist. Avoid print an error message caused by trying to read the file tests/tmpfs/group (for example).
Signed-off-by Theodore Ts'o <[email protected]>Where does this error message get emitted? I would have expected lots of people to notice this (e.g. NFS, CIFS, ext2, ext3, gfs2) if this was causing some kind of problem long before this...
It doesn't really cause a problem; it's more of a cosmetic issue, in that it prints a harmless/annoying error message during the test startup. It shows up if you specify a group, e.g. "check -g quick":
BEGIN TEST tmpfs: tmpfs Wed Feb 10 10:31:09 EST 2016
DEVICE: test:/tmp
MK2FS OPTIONS:
MOUNT OPTIONS: -oblock_validity
./check: line 96: tests/tmpfs/group: No such file or directoryFSTYP -- tmpfs PLATFORM -- Linux/i686 kvm-xfstests 4.5.0-rc2ext4-00002-g6df2762 MKFS_OPTIONS -- test:/scratch
MOUNT_OPTIONS-- -o size=1G test:/scratch /test/scratch
Quoted 3 lines
Quoted 1 line
generic/001 [10:31:10][ 5.811742] run fstests generic/001
Can you please rewrite the commit message to include this?
Sure, will do.
- Ted
Re: [PATCH 08/12] xfstests: fix generic/312 on tmpfs, ignore /proc/partitions
In reply to Dave ChinnerQuoted 6 lines · Dave Chinner
_scratch_mkfs_scratch_mount_require_fs_space$SCRATCH_MNT $((fssize / 1024))_scratch_unmount_scratch_mkfs_sized$fssize
This doesn't work because _require_fs_space uses df -klP, and the -l file systems with names such as "test:/scratch" to be filtered out --- and xfstests requires us to use NFS-looking names as a hint that the file system has no block device.
This results in "_require_fs_space" failing on tmpfs file systems with the error messages:
df: no file systems processed
./common/rc: line 1860: [: -lt: unary operator expected
I'm not sure why the -l option is being used at all in the first place. Any objections if I remove it? Presumably this is also causing _require_fs_space to blow up on any tests run using NFS....
Alternatively I could just remove if it $FSTYP == tmpfs, but that assumes there was some reason for using the -l option in the first place.
- Ted
Re: [PATCH 08/12] xfstests: fix generic/312 on tmpfs, ignore /proc/partitions
Quoted 16 lines · Theodore Ts'o
Quoted 6 lines · Dave Chinner
_scratch_mkfs_scratch_mount_require_fs_space$SCRATCH_MNT $((fssize / 1024))_scratch_unmount_scratch_mkfs_sized$fssizeThis doesn't work because
_require_fs_spaceuses df -klP, and the -l file systems with names such as "test:/scratch" to be filtered out --- and xfstests requires us to use NFS-looking names as a hint that the file system has no block device.This results in "
_require_fs_space" failing on tmpfs file systems with the error messages:
Quoted 6 lines
df: no file systems processed
./common/rc: line 1860: [: -lt: unary operator expectedI'm not sure why the -l option is being used at all in the first place. Any objections if I remove it? Presumably this is also causing
_require_fs_spaceto blow up on any tests run using NFS....
No idea on why -l is used. If there is a reason to be found, it will be in the commit history.
Quoted 3 lines
Alternatively I could just remove if it $FSTYP == tmpfs, but that assumes there was some reason for using the -l option in the first place.
Remove it, see what breaks/who complains.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 05/12] xfstests: do not unmount tmpfs during remount
In reply to Theodore Ts'oQuoted 11 lines · Theodore Ts'o
Quoted 9 lines · Dave Chinner
No, it's not really the options that are the problem here. The problem is -o remount vs unmount/mount and what the test is actually expecting.
I'd say "
_scratch_remount" should do "-o remount" unconditionally (least surprise) and the current_scratch_remountshould be changed to something like_scratch_cycle_mount(). That way both can take options, but it's clear they do different things. tmpfs can simply implement them the same way.
Quoted 5 lines
Well, I can do that, but it's going to be a huge patch --- the vast majority of the calls to
_scratch_remountin the tree (over 100) would have to be changed to_scratch_cycle_mount, because they are just doing a_scratch_umount/_scratch_mountwithout taking any arguments to change the mount option.
Yup, but we do this sort of tree-wide cleanup fairly often if it makes sense. In this case, it's just an initial patch taht does sed -i -e 's/_scratch_remount/_scratch_cycle_mount/' ....
And, let's put things in context: changing 108 lines of code is a pretty damn small patch in the greater scheme of things. Indeed, it's smaller than most patches that add a new regression test.
A "huge" patch is something like the series Darrick posted earlier in the week - something like 20 patches, including somewhere in the order of 30 new tests, a couple of new binary test programs, a heap of cleanups across all 80-90 existing reflink/dedupe tests, and a bunch of bug fixes to go with them.
IOWs, s/_scratch_remount/_scratch_cycle_mount/ is the sort of no-brainer change that takes less time to write, test and review than it did for me to write this email....
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 05/12] xfstests: do not unmount tmpfs during remount
Quoted 4 lines · Dave Chinner
IOWs, s/_scratch_remount/_scratch_cycle_mount/ is the sort of no-brainer change that takes less time to write, test and review than it did for me to write this email....
Fair enough, I'll make that change in the next rev of the patches. The current set should reflect all of the other review comments, though.
- Ted
Re: [PATCH 05/12] xfstests: do not unmount tmpfs during remount
Quoted 9 lines · Theodore Ts'o
Quoted 4 lines · Dave Chinner
IOWs, s/_scratch_remount/_scratch_cycle_mount/ is the sort of no-brainer change that takes less time to write, test and review than it did for me to write this email....
Fair enough, I'll make that change in the next rev of the patches. The current set should reflect all of the other review comments, though.
You might wait for the latest batch of reflink tests (the huge batch Dave referred to earlier in this thread) to land, as I use _scratch_remount in most of them.
--D
Quoted 6 lines
- Ted
--
To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html