xfstests: Check the file system consistency on SCRATCH_DEV
PATCH 1/2 xfstests: Check the file system consistency on SCRATCH_DEV
There are about 198 tests which requires scratch_dev, but does not check the file system consistency afterwards. Xfstests infrastructure does not do it automatically, so fix it by running _check_scratch_fs() after the test if access time changed on the scratch device.
Also remove all the _check_scratch_fs() calls that are not actually needed and will be covered by the check script.
--- check | 5 +++++ tests/btrfs/024 | 1 - tests/btrfs/043 | 2 -- tests/btrfs/044 | 2 -- tests/btrfs/045 | 2 -- tests/btrfs/046 | 2 -- tests/btrfs/047 | 2 -- tests/btrfs/048 | 2 -- tests/btrfs/050 | 2 -- tests/btrfs/051 | 2 -- tests/btrfs/053 | 2 -- tests/btrfs/054 | 2 -- tests/ext4/271 | 3 +-- tests/ext4/301 | 3 +-- tests/ext4/302 | 3 +-- tests/ext4/303 | 3 +-- tests/ext4/304 | 3 +-- tests/generic/009 | 0 tests/generic/017 | 6 ------ tests/generic/019 | 1 - tests/generic/026 | 0 tests/generic/027 | 1 - tests/generic/068 | 2 -- tests/generic/076 | 1 - tests/generic/083 | 1 - tests/generic/097 | 7 ------- tests/generic/099 | 7 ------- tests/generic/100 | 1 - tests/generic/117 | 2 -- tests/generic/124 | 3 --- tests/generic/204 | 2 -- tests/generic/269 | 3 +-- tests/generic/270 | 3 +-- tests/generic/273 | 3 +-- tests/generic/299 | 3 +-- tests/generic/300 | 3 +-- tests/generic/312 | 1 - tests/generic/315 | 0 tests/generic/320 | 1 - tests/generic/321 | 2 -- tests/generic/322 | 2 -- tests/shared/006 | 1 - tests/shared/272 | 3 +-- tests/xfs/010 | 1 - tests/xfs/011 | 1 - tests/xfs/013 | 1 - tests/xfs/014 | 1 - tests/xfs/019 | 3 --- tests/xfs/019.out | 1 - tests/xfs/034 | 2 -- tests/xfs/042 | 1 - tests/xfs/042.out | 1 - tests/xfs/085 | 6 ------ tests/xfs/085.out | 1 - tests/xfs/104 | 1 - tests/xfs/110 | 2 -- tests/xfs/121 | 3 --- tests/xfs/181 | 3 --- tests/xfs/278 | 5 ----- tests/xfs/297 | 1 - tests/xfs/306 | 1 - 61 files changed, 16 insertions(+), 119 deletions(-) mode change 100644 => 100755 tests/generic/009 mode change 100644 => 100755 tests/generic/026 mode change 100644 => 100755 tests/generic/315 mode change 100644 => 100755 tests/generic/321 mode change 100644 => 100755 tests/generic/322
check +5 -0
@@ -543,6 +543,7 @@ for section in $HOST_OPTIONS_SECTIONS; do fi rm -f core $seqres.notrun + scratch_atime=`stat -c %X $SCRATCH_DEV` start=`_wallclock` $timestamp && echo -n " ["`date "+%T"`"]" [ ! -x $seq ] && chmod u+x $seq # ensure we can run it
@@ -626,6 +627,10 @@ for section in $HOST_OPTIONS_SECTIONS; do try="$try $seqnum" n_try=`expr $n_try + 1` _check_test_fs + atime=`stat -c %X $SCRATCH_DEV` + if [ $atime -ne $scratch_atime ]; then + _check_scratch_fs + fi fi seq="after_$seqnum"
tests/btrfs/024 +0 -1
@@ -77,7 +77,6 @@ _scratch_mkfs > /dev/null 2>&1 _scratch_mount "-o compress-force=no" __workout _scratch_unmount -_check_scratch_fs echo "*** done" status=0 ; exit
tests/btrfs/043 +0 -2
@@ -143,7 +143,5 @@ run_check $FSSUM_PROG -r $tmp/1.fssum $SCRATCH_MNT/mysnap1 _run_btrfs_util_prog receive $SCRATCH_MNT -f $tmp/2.snap run_check $FSSUM_PROG -r $tmp/2.fssum $SCRATCH_MNT/mysnap2 -_check_scratch_fs - status=0 exit
tests/btrfs/044 +0 -2
@@ -123,7 +123,5 @@ run_check $FSSUM_PROG -r $tmp/1.fssum $SCRATCH_MNT/mysnap1 _run_btrfs_util_prog receive $SCRATCH_MNT -f $tmp/2.snap run_check $FSSUM_PROG -r $tmp/2.fssum $SCRATCH_MNT/mysnap2 -_check_scratch_fs - status=0 exit
tests/btrfs/045 +0 -2
@@ -370,7 +370,5 @@ run_check $FSSUM_PROG -r $tmp/1.fssum $SCRATCH_MNT/mysnap1 _run_btrfs_util_prog receive $SCRATCH_MNT -f $tmp/2.snap run_check $FSSUM_PROG -r $tmp/2.fssum $SCRATCH_MNT/mysnap2 -_check_scratch_fs - status=0 exit
tests/btrfs/046 +0 -2
@@ -298,7 +298,5 @@ echo "File digests in the replica filesystem:" md5sum $SCRATCH_MNT/mysnap1/foo | _filter_scratch md5sum $SCRATCH_MNT/mysnap2/foo | _filter_scratch -_check_scratch_fs - status=0 exit
tests/btrfs/047 +0 -2
@@ -116,7 +116,5 @@ $XFS_IO_PROG -r -c "seek -r -a 0" $SCRATCH_MNT/mysnap2/foo # the file's size. $XFS_IO_PROG -r -c "fiemap -v" $SCRATCH_MNT/mysnap2/foo | _filter_fiemap -_check_scratch_fs - status=0 exit
tests/btrfs/048 +0 -2
@@ -214,7 +214,5 @@ $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1 compression touch $SCRATCH_MNT/sv1/file2 $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1/file2 compression -_check_scratch_fs - status=0 exit
tests/btrfs/050 +0 -2
@@ -103,7 +103,5 @@ _scratch_mount _run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap run_check $FSSUM_PROG -r $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1 -_check_scratch_fs - status=0 exit
tests/btrfs/051 +0 -2
@@ -79,7 +79,5 @@ _scratch_mount _run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap run_check $FSSUM_PROG -r $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1 -_check_scratch_fs - status=0 exit
tests/btrfs/053 +0 -2
@@ -103,7 +103,5 @@ run_check $FSSUM_PROG -r $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1 _run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/2.snap run_check $FSSUM_PROG -r $send_files_dir/2.fssum $SCRATCH_MNT/mysnap2 -_check_scratch_fs - status=0 exit
tests/btrfs/054 +0 -2
@@ -103,7 +103,5 @@ _run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/2.snap [ -e $SCRATCH_MNT/testdir ] && \ echo "Directory testdir was supposed to be deleted after incremental send!" -_check_scratch_fs - status=0 exit
tests/ext4/271 +1 -2
@@ -62,6 +62,5 @@ if ! _scratch_unmount; then exit fi echo "Check filesystem" -_check_scratch_fs -status=$? +status=0 exit
tests/ext4/301 +1 -2
@@ -121,5 +121,4 @@ if ! _scratch_unmount; then status=1 exit fi -_check_scratch_fs -status=$? +status=0
tests/ext4/302 +1 -2
@@ -137,6 +137,5 @@ if ! _scratch_unmount; then status=1 exit fi -_check_scratch_fs -status=$? +status=0 exit
tests/ext4/303 +1 -2
@@ -147,6 +147,5 @@ if ! _scratch_unmount; then status=1 exit fi -_check_scratch_fs -status=$? +status=0 exit
tests/ext4/304 +1 -2
@@ -124,6 +124,5 @@ if ! _scratch_unmount; then status=1 exit fi -_check_scratch_fs -status=$? +status=0 exit
tests/generic/009 +0 -0
tests/generic/017 +0 -6
@@ -67,12 +67,6 @@ done # Check if 80 extents are present $XFS_IO_PROG -c "fiemap -v" $testfile | grep "^ *[0-9]*:" |wc -l -_check_scratch_fs -if [ $? -ne 0 ]; then - status=1 - exit -fi - # success, all done status=0 exit
tests/generic/019 +0 -1
@@ -171,7 +171,6 @@ _workout() # perform mount/umount, after that all errors should be fixed run_check _scratch_mount run_check _scratch_unmount - _check_scratch_fs } # real QA test starts here
tests/generic/026 +0 -0
tests/generic/027 +0 -1
@@ -101,7 +101,6 @@ while [ $i -le $loop ]; do let i=$i+1 done _scratch_unmount -_check_scratch_fs status=0 exit
tests/generic/068 +0 -2
@@ -130,6 +130,4 @@ rm $tmp.running # wait for fsstresses to finish wait -_check_scratch_fs - exit 1
tests/generic/076 +0 -1
@@ -77,7 +77,6 @@ FSSTRESS_ARGS=`_scale_fsstress_args -p 2 -n 2000 $FSSTRESS_AVOID` echo "run fsstress with args: $FSSTRESS_ARGS" >>$seqres.full $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full _lets_get_pidst -_check_scratch_fs echo "*** done" status=0
tests/generic/083 +0 -1
@@ -84,7 +84,6 @@ workout() # -w ensures that the only ops are ones which cause write I/O FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID` $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full - _check_scratch_fs } echo "*** test out-of-space handling for random write operations"
tests/generic/097 +0 -7
@@ -244,13 +244,6 @@ ${ATTR_PROG} -R -l foo cd / -# Check the filesystem -_check_scratch_fs - -# optional stuff if your test has verbose output to help resolve problems -#echo -#echo "If failure, check $seqres.full (this) and $seqres.full.ok (reference)" - # success, all done status=0 exit
tests/generic/099 +0 -7
@@ -328,13 +328,6 @@ chacl $acl3 largeaclfile _acl_list largeaclfile | _filter_aces_notypes #------------------------------------------------------- - -if [ "$FSTYP" == "udf" ]; then - cd / - umount $TARGET_DIR - # Check the filesystem - _check_scratch_fs -fi # success, all done status=0 exit
tests/generic/100 +0 -1
@@ -80,7 +80,6 @@ ls -R -l ${TEST_DIR}${POPULATED_DIR} >>$seqres.full 2>&1 diff -qr $POPULATED_DIR ${TEST_DIR}${POPULATED_DIR} cd / -_check_scratch_fs status=0 exit
tests/generic/117 +0 -2
@@ -108,8 +108,6 @@ cd / umount $SCRATCH_MNT echo echo Checking filesystem -_check_scratch_fs -_scratch_mount status=$? exit
tests/generic/124 +0 -3
@@ -76,7 +76,4 @@ fi umount $SCRATCH_DEV -_check_test_fs -_check_scratch_fs - exit
tests/generic/204 +0 -2
@@ -83,8 +83,6 @@ for i in `seq 1 $files`; do echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i done -_check_scratch_fs - # success, all done echo "*** done" status=0
tests/generic/269 +1 -2
@@ -79,6 +79,5 @@ if ! _scratch_unmount; then status=1 exit fi -_check_scratch_fs -status=$? +status=0 exit
tests/generic/270 +1 -2
@@ -104,6 +104,5 @@ if ! _scratch_unmount; then status=1 exit fi -_check_scratch_fs -status=$? +status=0 exit
tests/generic/273 +1 -2
@@ -138,6 +138,5 @@ _scratch_mount _do_workload -_check_scratch_fs -status=$? +status=0 exit
tests/generic/299 +1 -2
@@ -152,6 +152,5 @@ if ! _scratch_unmount; then status=1 exit fi -_check_scratch_fs -status=$? +status=0 exit
tests/generic/300 +1 -2
@@ -155,6 +155,5 @@ if ! _scratch_unmount; then status=1 exit fi -_check_scratch_fs -status=$? +status=0 exit
tests/generic/312 +0 -1
@@ -67,6 +67,5 @@ echo "Silence is golden" $XFS_IO_PROG -f -c "falloc 0 6g" $SCRATCH_MNT/testfile.$seq >>$seqres.full 2>&1 _scratch_unmount -_check_scratch_fs status=0 exit
tests/generic/315 +0 -0
tests/generic/320 +0 -1
@@ -116,6 +116,5 @@ _scratch_mount >>$seqres.full 2>&1 do_workload -_check_scratch_fs status=0 exit
tests/generic/321 +0 -2
@@ -121,8 +121,6 @@ _replay_rename_test() _ls_l $SCRATCH_MNT | tail -n +2 | awk '{ print $1, $9 }' _ls_l $SCRATCH_MNT/bar | tail -n +2 | awk '{ print $1, $9 }' _unmount_flakey - _check_scratch_fs $FLAKEY_DEV - [ $? -ne 0 ] && _fatal "fsck failed" } _scratch_mkfs >> $seqres.full 2>&1
tests/generic/322 +0 -2
@@ -94,8 +94,6 @@ _write_after_fsync_rename_test() _mount_flakey md5sum $SCRATCH_MNT/bar | _filter_scratch _unmount_flakey - _check_scratch_fs $FLAKEY_DEV - [ $? -ne 0 ] && _fatal "fsck failed" } _scratch_mkfs >> $seqres.full 2>&1
tests/shared/006 +0 -1
@@ -91,7 +91,6 @@ _check_scratch_fs rm -rf $SCRATCH_MNT/testdir echo "Inode status after deleting all test files" >>$seqres.full $DF_PROG -i $SCRATCH_MNT >>$seqres.full -_check_scratch_fs status=0 exit
tests/shared/272 +1 -2
@@ -103,6 +103,5 @@ if ! _scratch_unmount; then exit fi echo "Check filesystem" -_check_scratch_fs -status=$? +status=0 exit
tests/xfs/010 +0 -1
@@ -127,7 +127,6 @@ _check_scratch_fs _corrupt_finobt_root $SCRATCH_DEV _scratch_xfs_repair 2>&1 | _filter_repair -_check_scratch_fs status=0 exit
tests/xfs/011 +0 -1
@@ -110,7 +110,6 @@ killall $FSSTRESS_PROG wait umount $SCRATCH_MNT -_check_scratch_fs status=0 exit
tests/xfs/013 +0 -1
@@ -150,7 +150,6 @@ rm -rf $SCRATCH_MNT/fsstress rm -rf $SCRATCH_MNT/dir* umount $SCRATCH_MNT -_check_scratch_fs status=0 exit
tests/xfs/014 +0 -1
@@ -194,7 +194,6 @@ umount $LOOP_MNT echo $orig_sp_time > /proc/sys/fs/xfs/speculative_prealloc_lifetime umount $SCRATCH_MNT -_check_scratch_fs status=0 exit
tests/xfs/019 +0 -3
@@ -136,9 +136,6 @@ _verify_fs() _full "umount" umount $SCRATCH_DEV >>$seqfull 2>&1 \ || _fail "umount failed" - - echo "*** check FS" - _check_scratch_fs } #_verify_fs 1
tests/xfs/019.out +0 -1
@@ -79,6 +79,5 @@ Device: <DEVICE> Inode: <INODE> Links: 1 Mode: (0123/l--x-w--wx) Uid: (0) Gid: (0) Device: <DEVICE> Inode: <INODE> Links: 1 *** unmount FS -*** check FS *** done *** unmount
tests/xfs/034 +0 -2
@@ -83,8 +83,6 @@ then fi # pv 801241 causes corruption here (inode left in agi_unlinked list) -_check_scratch_fs - echo "*** done" # happy exit status=0
tests/xfs/042 +0 -1
@@ -162,7 +162,6 @@ if ! _do "diff $tmp.sum1 $tmp.sum2"; then status=1; exit fi echo "done" -_do "Checking filesystem" "_check_scratch_fs" # success, all done echo "xfs_fsr tests passed."
tests/xfs/042.out +0 -1
@@ -9,5 +9,4 @@ Remove other files... done Run xfs_fsr on filesystem... done Check fill file... done Check large file... done -Checking filesystem... done xfs_fsr tests passed.
tests/xfs/085 +0 -6
@@ -88,12 +88,6 @@ umount $SCRATCH_MNT echo "logprint after mount and replay..." _print_logstate -if _check_scratch_fs; then - echo "filesystem is checked ok" -else - echo "filesystem is NOT ok" -fi - # success, all done status=0 exit
tests/xfs/085.out +0 -1
@@ -111,4 +111,3 @@ ls SCRATCH_MNT unmount logprint after mount and replay... clean log -filesystem is checked ok
tests/xfs/104 +0 -1
@@ -113,7 +113,6 @@ done wait # stop for any remaining stress processes umount $SCRATCH_DEV -_check_scratch_fs status=0 exit
tests/xfs/110 +0 -2
@@ -81,7 +81,5 @@ do done wait -_check_scratch_fs - status=0 exit
tests/xfs/121 +0 -3
@@ -106,9 +106,6 @@ fi _scratch_mount >> $seqres.full 2>&1 \ || _fail "mount failed" -# should now be peaches -_check_scratch_fs - # success, all done status=0 exit
tests/xfs/181 +0 -3
@@ -120,9 +120,6 @@ fi _scratch_mount >> $seqres.full 2>&1 \ || _fail "mount failed" -# should now be peaches -_check_scratch_fs - # success, all done status=0 exit
tests/xfs/278 +0 -5
@@ -78,9 +78,4 @@ echo "" >>$seqres.full xfs_repair $SCRATCH_DEV >> $seqres.full 2>&1 echo "===== END of xfs_repair =====" >> $seqres.full -#if _check_scratch_fs; then -# status=0 -#else -# status=1 -#fi exit
tests/xfs/297 +0 -1
@@ -82,6 +82,5 @@ echo "Test done" | tee -a $seqres.full killall -q $FSSTRESS_PROG wait -_check_scratch_fs status=0 exit
tests/xfs/306 +0 -1
@@ -97,7 +97,6 @@ for d in $load_dir/*; do done wait umount $SCRATCH_MNT -_check_scratch_fs echo "No output is good. Failures are loud."
Signature · 1 line
1.8.3.1
PATCH 2/2 xfstests: Check fs consistency on TEST_DEV only when needed
Currently we're checking file system consistency on TEST_DEV after every successful test run even though the TEST_DEV might not even be used in that test.
Fix it by checking for number of write io on TEST_DEV device before the test and compare it with the value after the test.
--- check | 6 +++++- common/rc | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)
check +5 -1
@@ -544,6 +544,7 @@ for section in $HOST_OPTIONS_SECTIONS; do rm -f core $seqres.notrun scratch_atime=`stat -c %X $SCRATCH_DEV` + test_write_io=`_get_write_io_count $TEST_DEV` start=`_wallclock` $timestamp && echo -n " ["`date "+%T"`"]" [ ! -x $seq ] && chmod u+x $seq # ensure we can run it
@@ -626,7 +627,10 @@ for section in $HOST_OPTIONS_SECTIONS; do then try="$try $seqnum" n_try=`expr $n_try + 1` - _check_test_fs + write_io=`_get_write_io_count $TEST_DEV` + if [ -z $test_write_io ] || [ $write_io -ne $test_write_io ]; then + _check_test_fs + fi atime=`stat -c %X $SCRATCH_DEV` if [ $atime -ne $scratch_atime ]; then _check_scratch_fs
common/rc +11 -0
@@ -2165,6 +2165,17 @@ _scale_fsstress_args() echo $args } +_get_write_io_count() +{ + if [ -z $1 ]; then + echo "Missing device argument for _get_write_io_count" + exit 1 + fi + major_minor=$(printf "%d:%d" `stat -c "0x%t" $1` `stat -c "0x%T" $1`) + sync + cat /sys/dev/block/${major_minor}/stat 2> /dev/null | awk '{print $5}' +} + # # Return the logical block size if running on a block device, # else substitute the page size.
Signature · 1 line
1.8.3.1
Re: [PATCH 2/2] xfstests: Check fs consistency on TEST_DEV only when needed
Quoted 3 lines · Lukas Czerner
Currently we're checking file system consistency on
TEST_DEVafter every successful test run even though theTEST_DEVmight not even be used in that test.
It gets mounted/unmounted for each test, so even if it is not used, it might still get modified...
Quoted 2 lines
Fix it by checking for number of write io on
TEST_DEVdevice before the test and compare it with the value after the test.
Doesn't work for ram disks:
# ./setup
TEST: DIR=/mnt/test DEV=/dev/ram0 rt=[] log=[]
TAPE: dev=[] rmt=[] rmtirix=[@]
SCRATCH: MNT=/mnt/scr DEV=/dev/ram1 rt=[] log=[]
VARIABLES: external=no largeblk=no fstyp=xfs
large_scratch_dev=no attrsecure=no
# ls -l /dev/ram0
brw-rw---- 1 root disk 1, 0 Jul 9 15:51 /dev/ram0
# cat /sys/dev/block/1\:0/stat
0 0 0 0 0 0 0 0 0 0 0
#Nor does it work on loop devices.
Quoted 19 lines
Signed-off-by Lukas Czerner <[email protected]>--- check | 6 +++++- common/rc | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)check +1
-0@@ -544,6 +544,7 @@ for section in $HOST_OPTIONS_SECTIONS; do rm -f core $seqres.notrun scratch_atime=`stat -c %X $SCRATCH_DEV` + test_write_io=`_get_write_io_count $TEST_DEV` start=`_wallclock` $timestamp && echo -n " ["`date "+%T"`"]" [ ! -x $seq ] && chmod u+x $seq # ensure we can run it
check for section in $HOST_OPTIONS_SECTIONS; do · line 633
Quoted 8 lines
check +4
-1@@ -626,7 +627,10 @@ for section in $HOST_OPTIONS_SECTIONS; do then try="$try $seqnum" n_try=`expr $n_try + 1` - _check_test_fs + write_io=`_get_write_io_count $TEST_DEV` + if [ -z $test_write_io ] || [ $write_io -ne $test_write_io ]; then + _check_test_fs + fi
Which you work around without mentioning the reason for the zero value check. ;)
Personally, I want the test devices on my systems checked regardless of whether the test tries to modify them or not. I, quite frankly, don't trust the block device stats because they often get broken or are inaccurate. Indeed, there were recent virtio block device changes in 3.14-rc1 (or was it 3.15?) that broke the device stats and that took several weeks to get fixed properly.
Hence I don't think using the block device stats for something as critical as determining whether we should check a filesystem or not.
Reducing runtime of the test harness is a good idea, but we should not do that if the cost is that it reduces the reliability of error detection.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 2/2] xfstests: Check fs consistency on TEST_DEV only when needed
Quoted 3 lines · Dave Chinner
Reducing runtime of the test harness is a good idea, but we should not do that if the cost is that it reduces the reliability of error detection.
Still, this could have a really big impact, especially on filesystems with slow fsck.
It'd be great to find a way to make this reliable.
It's kind of a historical accident that "test" is always mounted, but "scratch" must be _required. What if we added _require_test if we're going to write to test, and doing so triggers the check?
I'm sure there are other ways around it. Spending tons of time in fsck for a filesystem we didn't touch isn't time well spent, IMHO.
-Eric
Re: [PATCH 2/2] xfstests: Check fs consistency on TEST_DEV only when needed
In reply to Dave ChinnerQuoted 56 lines · Dave Chinner
Date: Thu, 10 Jul 2014 11:07:11 +1000
From: Dave Chinner <[email protected]>
To: Lukas Czerner <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCH 2/2] xfstests: Check fs consistency onTEST_DEVonly when
neededQuoted 3 lines · Lukas Czerner
Currently we're checking file system consistency on
TEST_DEVafter every successful test run even though theTEST_DEVmight not even be used in that test.It gets mounted/unmounted for each test, so even if it is not used, it might still get modified...
Quoted 2 lines
Fix it by checking for number of write io on
TEST_DEVdevice before the test and compare it with the value after the test.Doesn't work for ram disks:
# ./setup TEST: DIR=/mnt/test DEV=/dev/ram0 rt=[] log=[] TAPE: dev=[] rmt=[] rmtirix=[@] SCRATCH: MNT=/mnt/scr DEV=/dev/ram1 rt=[] log=[] VARIABLES: external=no largeblk=no fstyp=xfs large_scratch_dev=no attrsecure=no # ls -l /dev/ram0 brw-rw---- 1 root disk 1, 0 Jul 9 15:51 /dev/ram0 # cat /sys/dev/block/1\:0/stat 0 0 0 0 0 0 0 0 0 0 0 #Nor does it work on loop devices.
Quoted 22 lines
Signed-off-by Lukas Czerner <[email protected]>--- check | 6 +++++- common/rc | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)check +1
-0@@ -544,6 +544,7 @@ for section in $HOST_OPTIONS_SECTIONS; do rm -f core $seqres.notrun scratch_atime=`stat -c %X $SCRATCH_DEV` + test_write_io=`_get_write_io_count $TEST_DEV` start=`_wallclock` $timestamp && echo -n " ["`date "+%T"`"]" [ ! -x $seq ] && chmod u+x $seq # ensure we can run it@@ -626,7 +627,10 @@ for section in $HOST_OPTIONS_SECTIONS; do then try="$try $seqnum" n_try=`expr $n_try + 1`
Quoted 8 lines
check for section in $HOST_OPTIONS_SECTIONS; do · line 633
Quoted 5 lines
check +4
-1- _check_test_fs + write_io=`_get_write_io_count $TEST_DEV` + if [ -z $test_write_io ] || [ $write_io -ne $test_write_io ]; then + _check_test_fs + fiWhich you work around without mentioning the reason for the zero value check. ;)
That's just a safety trigger :) Didn't think it was worth mentioning.
Quoted 8 lines
Personally, I want the test devices on my systems checked regardless of whether the test tries to modify them or not. I, quite frankly, don't trust the block device stats because they often get broken or are inaccurate. Indeed, there were recent virtio block device changes in 3.14-rc1 (or was it 3.15?) that broke the device stats and that took several weeks to get fixed properly.
Quoted 6 lines
Hence I don't think using the block device stats for something as critical as determining whether we should check a filesystem or not.
Reducing runtime of the test harness is a good idea, but we should not do that if the cost is that it reduces the reliability of error detection.
With the patch 1/2 we're going to check scratch dev as well, so if accepted, the xfstests run time is going to be possibly much longer especially so on the file systems where fsck time is quite big. So I think that trying to reduce unnecessary fsck on test_dev is IMO important.
I like the idea Eric proposed with the _require_test check for the test that actually require test device and then actually check the device only after such test. Will that be acceptable ? If so I'll rework the patches.
Thanks!
-Lukas
Quoted 5 lines
Cheers,
Dave.
Re: [PATCH 2/2] xfstests: Check fs consistency on TEST_DEV only when needed
Quoted 5 lines · Lukáš Czerner
On Thu, 10 Jul 2014, Dave Chinner wrote:
I like the idea Eric proposed with the_require_testcheck for the test that actually require test device and then actually check the device only after such test. Will that be acceptable ? If so I'll rework the patches.
Works for me. Don't forget to add it to the "new" script as well so the default is to check the test device. That will trigger us to check if it is necessary during test development review, rather than forgetting we need to add it. ;)
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]