make xfs/tests generic by introducing shutdown for filesystems
v4 cover make xfs/tests generic by introducing shutdown for filesystems
This patch-set modifies several existing xfs's tests to be used by generic filesystems.
1. FS requirement
In order to activate these testcases, filesystem should support a new feature, shutdown, triggered by the following ioctl command.
#define FS_IOC_SHUTDOWN _IOR('X', 125, __u32) /* Shutdown */
This ioctl needs one of three modes passed by a flag according to the syncing policy.
#define FS_GOING_DOWN_FULLSYNC 0x0 /* going down with full sync */ #define FS_GOING_DOWN_METASYNC 0x1 /* going down with metadata */ #define FS_GOING_DOWN_NOSYNC 0x2 /* going down */
Whenever shutdown is requested with one of the above mode, filesystem must stop any IOs, and wait for unmount, which is very useful to test power-off- recovery.
2. Changes in xfstests
In this patch set, common/rc adds three macros:
o _require_scratch_shutdown : check whether FS supports shutdown
o _require_bmap : check bmap tool is defined
o _require_norecovery : check filesystem supports norecovery option.
The following tests become generic.
xfs/051 -> generic/051
* xfs/053 -> generic/054
xfs/085 -> generic/085
xfs/086 -> generic/086
xfs/087 -> generic/087
xfs/137 -> generic/137
xfs/138 -> generic/138
xfs/139 -> generic/139
xfs/140 -> generic/140
xfs/179 -> generic/179
xfs/180 -> generic/180
xfs/182 -> generic/182
xfs/200 -> generic/200* xfs/306 -> generic/305
*) changed test numbers due to conflict.
Jaeeuk Km (8)
comon/rc: add _require_scratch_shtudown
common/rc: add _require_bmap
common/rc: add _require_norecovery
tests/xfs: convert 10 xfs's tests to be generic ones tests/generic: relocate xfs's tests into tests/generic/ common/rc: define dump.f2fs and logstate for f2fs tests/xfs: add f2fs testcase and convert them being generic tests/generic: relocate four xfs's tests into tests/generic/
common/config | 3 + common/log | 20 +- common/rc | 59 + tests/generic/051 | 103 + tests/generic/051.out | 2 + tests/generic/054 | 102 + tests/generic/054.out | 10 + tests/generic/085 | 98 + tests/generic/085.out | 113 ++ tests/generic/086 | 178 ++ tests/generic/086.out.f2fs | 3306 +++++++++++++++++++++++++++++++ tests/generic/086.out.xfs | 4722 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/087 | 179 ++ tests/generic/087.out.f2fs | 303 +++ tests/generic/087.out.xfs | 389 ++++ tests/generic/137 | 106 + tests/generic/137.out | 1 + tests/generic/138 | 112 ++ tests/generic/138.out | 1 + tests/generic/139 | 112 ++ tests/generic/139.out | 1 + tests/generic/140 | 109 + tests/generic/140.out | 1 + tests/generic/179 | 107 + tests/generic/179.out | 1 + tests/generic/180 | 111 ++ tests/generic/180.out | 1 + tests/generic/182 | 108 + tests/generic/182.out | 1 + tests/generic/200 | 127 ++ tests/generic/200.out | 24 + tests/generic/305 | 105 + tests/generic/305.out | 2 + tests/generic/group | 14 + tests/xfs/051 | 95 - tests/xfs/051.out | 2 - tests/xfs/053 | 101 - tests/xfs/053.out | 10 - tests/xfs/085 | 93 - tests/xfs/085.out | 113 -- tests/xfs/086 | 152 -- tests/xfs/086.out | 4722 -------------------------------------------- tests/xfs/087 | 153 -- tests/xfs/087.out | 389 ---- tests/xfs/137 | 104 - tests/xfs/137.out | 1 - tests/xfs/138 | 110 -- tests/xfs/138.out | 1 - tests/xfs/139 | 110 -- tests/xfs/139.out | 1 - tests/xfs/140 | 107 - tests/xfs/140.out | 1 - tests/xfs/179 | 105 - tests/xfs/179.out | 1 - tests/xfs/180 | 109 - tests/xfs/180.out | 1 - tests/xfs/182 | 106 - tests/xfs/182.out | 1 - tests/xfs/200 | 125 -- tests/xfs/200.out | 24 - tests/xfs/306 | 104 - tests/xfs/306.out | 2 - tests/xfs/group | 14 - 63 files changed, 10628 insertions(+), 6860 deletions(-) create mode 100755 tests/generic/051 create mode 100644 tests/generic/051.out create mode 100755 tests/generic/054 create mode 100644 tests/generic/054.out create mode 100755 tests/generic/085 create mode 100644 tests/generic/085.out create mode 100755 tests/generic/086 create mode 100644 tests/generic/086.out.f2fs create mode 100644 tests/generic/086.out.xfs create mode 100755 tests/generic/087 create mode 100644 tests/generic/087.out.f2fs create mode 100644 tests/generic/087.out.xfs create mode 100755 tests/generic/137 create mode 100644 tests/generic/137.out create mode 100755 tests/generic/138 create mode 100644 tests/generic/138.out create mode 100755 tests/generic/139 create mode 100644 tests/generic/139.out create mode 100755 tests/generic/140 create mode 100644 tests/generic/140.out create mode 100755 tests/generic/179 create mode 100644 tests/generic/179.out create mode 100755 tests/generic/180 create mode 100644 tests/generic/180.out create mode 100755 tests/generic/182 create mode 100644 tests/generic/182.out create mode 100755 tests/generic/200 create mode 100644 tests/generic/200.out create mode 100755 tests/generic/305 create mode 100644 tests/generic/305.out delete mode 100755 tests/xfs/051 delete mode 100644 tests/xfs/051.out delete mode 100755 tests/xfs/053 delete mode 100644 tests/xfs/053.out delete mode 100755 tests/xfs/085 delete mode 100644 tests/xfs/085.out delete mode 100755 tests/xfs/086 delete mode 100644 tests/xfs/086.out delete mode 100755 tests/xfs/087 delete mode 100644 tests/xfs/087.out delete mode 100755 tests/xfs/137 delete mode 100644 tests/xfs/137.out delete mode 100755 tests/xfs/138 delete mode 100644 tests/xfs/138.out delete mode 100755 tests/xfs/139 delete mode 100644 tests/xfs/139.out delete mode 100755 tests/xfs/140 delete mode 100644 tests/xfs/140.out delete mode 100755 tests/xfs/179 delete mode 100644 tests/xfs/179.out delete mode 100755 tests/xfs/180 delete mode 100644 tests/xfs/180.out delete mode 100755 tests/xfs/182 delete mode 100644 tests/xfs/182.out delete mode 100755 tests/xfs/200 delete mode 100644 tests/xfs/200.out delete mode 100755 tests/xfs/306 delete mode 100644 tests/xfs/306.out
Signature · 1 line
2.1.1
PATCH v4 1/8 common/rc: add _require_scratch_shtudown
This is to detect whether filesystem supports shutdown feature or not.
--- common/rc | 11 +++++++++++ 1 file changed, 11 insertions(+)
common/rc +11 -0
@@ -2320,6 +2320,17 @@ _require_freeze() [ $result -eq 0 ] || _notrun "$FSTYP does not support freezing" } +# Does shutdown work on this fs? +_require_scratch_shutdown() +{ + [ -x src/godown ] || _notrun "src/godown executable not found" + + _scratch_mount + src/godown -v -f $SCRATCH_MNT >/dev/null 2>&1 \ + || _notrun "$FSTYP does not support shutdown" + _scratch_unmount +} + # arg 1 is dev to remove and is output of the below eg. # ls -l /sys/class/block/sdd | rev | cut -d "/" -f 3 | rev _devmgt_remove()
Signature · 1 line
2.1.1
Re: [PATCH 1/8 v4] common/rc: add _require_scratch_shtudown
Quoted 12 lines · Jaegeuk Kim
This is to detect whether filesystem supports shutdown feature or not.
Signed-off-by Jaegeuk Kim <[email protected]>--- common/rc | 11 +++++++++++ 1 file changed, 11 insertions(+)common/rc +0
-0
common/rc _require_freeze() · line 2328
Quoted 9 lines
common/rc +6
-0@@ -2320,6 +2320,17 @@ _require_freeze() [ $result -eq 0 ] || _notrun "$FSTYP does not support freezing" } +# Does shutdown work on this fs? +_require_scratch_shutdown() +{ + [ -x src/godown ] || _notrun "src/godown executable not found" + + _scratch_mount
Whitespace damage. Also, the state of the scratch device is undefined until scratch_mkfs is run.
common/rc _require_freeze() · line 2330
Quoted 2 lines
common/rc +2
-0+ src/godown -v -f $SCRATCH_MNT >/dev/null 2>&1 \ + || _notrun "$FSTYP does not support shutdown"
Why verbose if you are redirecting all output to /dev/null?
common/rc _require_freeze() · line 2332
Quoted 2 lines
common/rc +2
-0+ _scratch_unmount +}
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH v4 2/8 common/rc: add _require_bmap
In reply to Jaegeuk KimThis is to detect whether the filesystem tool supports bmap or not.
--- common/config | 2 ++ common/rc | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+)
common/config +2 -0
@@ -168,6 +168,7 @@ if [ -n "$__XFSDUMP_PROG" ]; then else export XFSDUMP_PROG="" fi +export BMAP_XFS_PROG="`set_prog_path xfs_bmap`" export XFSRESTORE_PROG="`set_prog_path xfsrestore`" export XFSINVUTIL_PROG="`set_prog_path xfsinvutil`" export GETFATTR_PROG="`set_prog_path getfattr`"
@@ -220,6 +221,7 @@ case "$HOSTOS" in export MKFS_UDF_PROG="`set_prog_path mkudffs`" export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`" export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`" + export BMAP_F2FS_PROG="`set_prog_path fibmap.f2fs`" export BTRFS_UTIL_PROG="`set_prog_path btrfs`" export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`" export XFS_FSR_PROG="`set_prog_path xfs_fsr`"
common/rc +18 -0
@@ -2331,6 +2331,24 @@ _require_scratch_shutdown() _scratch_unmount } +# Does bmap work on this fs? +_require_bmap() +{ + case "$FSTYP" in + xfs) + _require_command $BMAP_XFS_PROG + export BMAP_PROG=$BMAP_XFS_PROG + ;; + f2fs) + _require_command $BMAP_F2FS_PROG + export BMAP_PROG=$BMAP_F2FS_PROG + ;; + *) + _notrun "$FSTYP does not support bmap" + ;; + esac +} + # arg 1 is dev to remove and is output of the below eg. # ls -l /sys/class/block/sdd | rev | cut -d "/" -f 3 | rev _devmgt_remove()
Signature · 1 line
2.1.1
Re: [PATCH 2/8 v4] common/rc: add _require_bmap
Quoted 1 line · Jaegeuk Kim
This is to detect whether the filesystem tool supports bmap or not.
xfs_bmap is essentially deprecated. Please convert the tests to use fiemap rather than requiring new infrastructure to support new block mapping tools.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH v4 3/8 common/rc: add _require_norecovery
In reply to Jaegeuk KimThis patch adds checking code whether filesystem supports norecovery mount option or not.
--- common/rc | 8 ++++++++ 1 file changed, 8 insertions(+)
common/rc +8 -0
@@ -2331,6 +2331,14 @@ _require_scratch_shutdown() _scratch_unmount } +# Does norecovery support by this fs? +_require_norecovery() +{ + _scratch_mount -o ro,norecovery || \ + _notrun "$FSTYP does not support norecovery" + _scratch_unmount +} + # Does bmap work on this fs? _require_bmap() {
Signature · 1 line
2.1.1
Re: [PATCH 3/8 v4] common/rc: add _require_norecovery
Quoted 13 lines · Jaegeuk Kim
This patch adds checking code whether filesystem supports norecovery mount option or not.
Signed-off-by Jaegeuk Kim <[email protected]>--- common/rc | 8 ++++++++ 1 file changed, 8 insertions(+)common/rc +0
-0
common/rc _require_scratch_shutdown() · line 2340
Quoted 10 lines
common/rc +7
-0@@ -2331,6 +2331,14 @@ _require_scratch_shutdown() _scratch_unmount } +# Does norecovery support by this fs? +_require_norecovery() +{ + _scratch_mount -o ro,norecovery || \ + _notrun "$FSTYP does not support norecovery" + _scratch_unmount +}
What's the point of making tests that use an XFS specific mount option generic? If it requires this it is still an XFS specific test, right?
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH v4 4/8 tests/xfs: convert 10 xfs's tests to be generic ones
In reply to Jaegeuk KimThis patch changes ten xfs's testcases to be generic ones, pointed out by Dave.
xfs/053 (data exposure) xfs/137 (data vs filesize) xfs/138 (data vs filesize vs truncate) xfs/139 (data vs filesize vs partial truncate) xfs/140 (data vs filesize vs extending truncate) xfs/179 (data vs filesize w/ fsync) xfs/180 (data vs filesize w/ sync) xfs/182 (data vs filesize w/ recovery) xfs/200 (recovery vs ro-block device) xfs/306 (fsstress vs recovery)
All these tests need _require_scratch_shutdown, and some of them need _require_bmap utils.
--- tests/xfs/053 | 3 ++- tests/xfs/137 | 10 ++++++---- tests/xfs/138 | 10 ++++++---- tests/xfs/139 | 10 ++++++---- tests/xfs/140 | 8 +++++--- tests/xfs/179 | 8 +++++--- tests/xfs/180 | 8 +++++--- tests/xfs/182 | 8 +++++--- tests/xfs/200 | 6 ++++-- tests/xfs/306 | 3 ++- 10 files changed, 46 insertions(+), 28 deletions(-)
tests/xfs/053 +2 -1
@@ -83,9 +83,10 @@ _crashtest() } # Modify as appropriate. -_supported_fs xfs +_supported_fs generic _supported_os Linux _require_scratch +_require_scratch_shutdown _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" _require_xfs_io_command "fzero"
tests/xfs/137 +6 -4
@@ -36,11 +36,13 @@ trap "exit \$status" 0 1 2 3 15 . ./common/filter # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os Linux IRIX _require_scratch -_scratch_mkfs_xfs >/dev/null 2>&1 +_require_scratch_shutdown +_require_bmap +_scratch_mkfs >/dev/null 2>&1 _scratch_mount # create files
@@ -84,10 +86,10 @@ do if [ -s $file ] then # if file has non-zero size but no extents then it's contents will be NULLs, bad. - if xfs_bmap $file | grep 'no extents' > /dev/null + if $BMAP_PROG $file | grep 'no extents' > /dev/null then echo corrupt file $file - non-zero size but no extents - elif xfs_bmap $file | grep 'hole' > /dev/null + elif $BMAP_PROG $file | grep 'hole' > /dev/null then echo corrupt file $file - contains holes else
tests/xfs/138 +6 -4
@@ -36,11 +36,13 @@ trap "exit \$status" 0 1 2 3 15 . ./common/filter # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os Linux IRIX _require_scratch -_scratch_mkfs_xfs >/dev/null 2>&1 +_require_scratch_shutdown +_require_bmap +_scratch_mkfs >/dev/null 2>&1 _scratch_mount # create files
@@ -90,10 +92,10 @@ do if [ -s $file ] then # if file has non-zero size but no extents then it's contents will be NULLs, bad. - if xfs_bmap $file | grep 'no extents' > /dev/null + if $BMAP_PROG $file | grep 'no extents' > /dev/null then echo corrupt file $file - non-zero size but no extents - elif xfs_bmap $file | grep 'hole' > /dev/null + elif $BMAP_PROG $file | grep 'hole' > /dev/null then echo corrupt file $file - contains holes else
tests/xfs/139 +6 -4
@@ -36,11 +36,13 @@ trap "exit \$status" 0 1 2 3 15 . ./common/filter # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os Linux IRIX _require_scratch -_scratch_mkfs_xfs >/dev/null 2>&1 +_require_scratch_shutdown +_require_bmap +_scratch_mkfs >/dev/null 2>&1 _scratch_mount # create files
@@ -90,10 +92,10 @@ do if [ -s $file ] then # if file has non-zero size but no extents then it's contents will be NULLs, bad. - if xfs_bmap $file | grep 'no extents' > /dev/null + if $BMAP_PROG $file | grep 'no extents' > /dev/null then echo corrupt file $file - non-zero size but no extents - elif xfs_bmap $file | grep 'hole' > /dev/null + elif $BMAP_PROG $file | grep 'hole' > /dev/null then echo corrupt file $file - contains holes else
tests/xfs/140 +5 -3
@@ -36,11 +36,13 @@ trap "exit \$status" 0 1 2 3 15 . ./common/filter # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os Linux IRIX _require_scratch -_scratch_mkfs_xfs >/dev/null 2>&1 +_require_scratch_shutdown +_require_bmap +_scratch_mkfs >/dev/null 2>&1 _scratch_mount # create files
@@ -90,7 +92,7 @@ do if [ -s $file ] then # if file has non-zero size but no extents then it's contents will be NULLs, bad. - if xfs_bmap $file | grep 'no extents' > /dev/null + if $BMAP_PROG $file | grep 'no extents' > /dev/null then echo corrupt file $file - non-zero size but no extents else
tests/xfs/179 +5 -3
@@ -37,11 +37,13 @@ trap "exit \$status" 0 1 2 3 15 . ./common/filter # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os Linux IRIX _require_scratch -_scratch_mkfs_xfs >/dev/null 2>&1 +_require_scratch_shutdown +_require_bmap +_scratch_mkfs >/dev/null 2>&1 _scratch_mount _check_files()
@@ -58,7 +60,7 @@ _check_files() if [ `ls -l $file | tr -s ' ' | cut -d ' ' -f 5` -eq 32768 ] then # if file has non-zero size but no extents then it's contents will be NULLs, bad. - if xfs_bmap $file | grep 'no extents' > /dev/null + if $BMAP_PROG $file | grep 'no extents' > /dev/null then echo corrupt file $file - non-zero size but no extents else
tests/xfs/180 +5 -3
@@ -37,11 +37,13 @@ trap "exit \$status" 0 1 2 3 15 . ./common/filter # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os Linux IRIX _require_scratch -_scratch_mkfs_xfs >/dev/null 2>&1 +_require_scratch_shutdown +_require_bmap +_scratch_mkfs >/dev/null 2>&1 _scratch_mount # Do we have enough space on disk? 10G
@@ -61,7 +63,7 @@ _check_files() if [ `ls -l $file | tr -s ' ' | cut -d ' ' -f 5` -eq 10485760 ] then # if file has non-zero size but no extents then it's contents will be NULLs, bad. - if xfs_bmap $file | grep 'no extents' > /dev/null + if $BMAP_PROG $file | grep 'no extents' > /dev/null then echo corrupt file $file - non-zero size but no extents else
tests/xfs/182 +5 -3
@@ -37,11 +37,13 @@ trap "exit \$status" 0 1 2 3 15 . ./common/filter # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os Linux IRIX _require_scratch -_scratch_mkfs_xfs >/dev/null 2>&1 +_require_scratch_shutdown +_require_bmap +_scratch_mkfs >/dev/null 2>&1 _scratch_mount _check_files()
@@ -58,7 +60,7 @@ _check_files() if [ `ls -l $file | tr -s ' ' | cut -d ' ' -f 5` -eq 32768 ] then # if file has non-zero size but no extents then it's contents will be NULLs, bad. - if xfs_bmap $file | grep 'no extents' > /dev/null + if $BMAP_PROG $file | grep 'no extents' > /dev/null then echo corrupt file $file - non-zero size but no extents else
tests/xfs/200 +4 -2
@@ -41,12 +41,14 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common/filter # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os Linux _require_scratch_nocheck +_require_scratch_shutdown +_require_norecovery -_scratch_mkfs_xfs >/dev/null 2>&1 +_scratch_mkfs >/dev/null 2>&1 # # Mark the device read-only
tests/xfs/306 +2 -1
@@ -45,10 +45,11 @@ _cleanup() trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os Linux _require_scratch +_require_scratch_shutdown rm -f $seqres.full
Signature · 1 line
2.1.1
Re: [PATCH 4/8 v4] tests/xfs: convert 10 xfs's tests to be generic ones
Quoted 35 lines · Jaegeuk Kim
This patch changes ten xfs's testcases to be generic ones, pointed out by Dave.
xfs/053 (data exposure) xfs/137 (data vs filesize) xfs/138 (data vs filesize vs truncate) xfs/139 (data vs filesize vs partial truncate) xfs/140 (data vs filesize vs extending truncate) xfs/179 (data vs filesize w/ fsync) xfs/180 (data vs filesize w/ sync) xfs/182 (data vs filesize w/ recovery) xfs/200 (recovery vs ro-block device) xfs/306 (fsstress vs recovery)All these tests need
_require_scratch_shutdown, and some of them need_require_bmaputils.Suggested-by Dave Chinner <[email protected]>Signed-off-by Jaegeuk Kim <[email protected]>--- tests/xfs/053 | 3 ++- tests/xfs/137 | 10 ++++++---- tests/xfs/138 | 10 ++++++---- tests/xfs/139 | 10 ++++++---- tests/xfs/140 | 8 +++++--- tests/xfs/179 | 8 +++++--- tests/xfs/180 | 8 +++++--- tests/xfs/182 | 8 +++++--- tests/xfs/200 | 6 ++++-- tests/xfs/306 | 3 ++- 10 files changed, 46 insertions(+), 28 deletions(-)tests/xfs/053 +0
-0
tests/xfs/053 _crashtest() · line 89
Quoted 8 lines
tests/xfs/053 +2
-1@@ -83,9 +83,10 @@ _crashtest() } # Modify as appropriate. -_supported_fs xfs +_supported_fs generic _supported_os Linux _require_scratch +_require_scratch_shutdown
Can't do that - scratch needs to be mkfs'd before you can mount it.
Quoted 5 lines
index 79b3b89..6ec1bcb 100755
tests/xfs/137 +0
-0@@ -36,11 +36,13 @@ trap "exit \$status" 0 1 2 3 15 . ./common/filter
tests/xfs/137 trap "exit \$status" 0 1 2 3 15 · line 44
Quoted 10 lines
tests/xfs/137 +3
-2# real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os Linux IRIX _require_scratch -_scratch_mkfs_xfs >/dev/null 2>&1 +_require_scratch_shutdown +_require_bmap
needs to be converted to fiemap and that done as a separate step.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH v4 5/8 tests/generic: relocate xfs's tests into tests/generic/
In reply to Jaegeuk KimThis patch moves the generic testcases defined in xfs into tests/generic/.
* xfs/053 -> generic/054
xfs/137 -> generic/137
xfs/138 -> generic/138
xfs/139 -> generic/139
xfs/140 -> generic/140
xfs/179 -> generic/179
xfs/180 -> generic/180
xfs/182 -> generic/182
xfs/200 -> generic/200
* xfs/306 -> generic/305
* The test number was changed to address conflicts.
--- tests/generic/054 | 102 ++++++++++++++++++++++++++++++++++++++++ tests/generic/054.out | 10 ++++ tests/generic/137 | 106 +++++++++++++++++++++++++++++++++++++++++ tests/generic/137.out | 1 + tests/generic/138 | 112 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/138.out | 1 + tests/generic/139 | 112 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/139.out | 1 + tests/generic/140 | 109 +++++++++++++++++++++++++++++++++++++++++++ tests/generic/140.out | 1 + tests/generic/179 | 107 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/179.out | 1 + tests/generic/180 | 111 +++++++++++++++++++++++++++++++++++++++++++ tests/generic/180.out | 1 + tests/generic/182 | 108 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/182.out | 1 + tests/generic/200 | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/200.out | 24 ++++++++++ tests/generic/305 | 105 +++++++++++++++++++++++++++++++++++++++++ tests/generic/305.out | 2 + tests/generic/group | 10 ++++ tests/xfs/053 | 102 ---------------------------------------- tests/xfs/053.out | 10 ---- tests/xfs/137 | 106 ----------------------------------------- tests/xfs/137.out | 1 - tests/xfs/138 | 112 -------------------------------------------- tests/xfs/138.out | 1 - tests/xfs/139 | 112 -------------------------------------------- tests/xfs/139.out | 1 - tests/xfs/140 | 109 ------------------------------------------- tests/xfs/140.out | 1 - tests/xfs/179 | 107 ------------------------------------------ tests/xfs/179.out | 1 - tests/xfs/180 | 111 ------------------------------------------- tests/xfs/180.out | 1 - tests/xfs/182 | 108 ------------------------------------------ tests/xfs/182.out | 1 - tests/xfs/200 | 127 -------------------------------------------------- tests/xfs/200.out | 24 ---------- tests/xfs/306 | 105 ----------------------------------------- tests/xfs/306.out | 2 - tests/xfs/group | 10 ---- 42 files changed, 1152 insertions(+), 1152 deletions(-) create mode 100755 tests/generic/054 create mode 100644 tests/generic/054.out create mode 100755 tests/generic/137 create mode 100644 tests/generic/137.out create mode 100755 tests/generic/138 create mode 100644 tests/generic/138.out create mode 100755 tests/generic/139 create mode 100644 tests/generic/139.out create mode 100755 tests/generic/140 create mode 100644 tests/generic/140.out create mode 100755 tests/generic/179 create mode 100644 tests/generic/179.out create mode 100755 tests/generic/180 create mode 100644 tests/generic/180.out create mode 100755 tests/generic/182 create mode 100644 tests/generic/182.out create mode 100755 tests/generic/200 create mode 100644 tests/generic/200.out create mode 100755 tests/generic/305 create mode 100644 tests/generic/305.out delete mode 100755 tests/xfs/053 delete mode 100644 tests/xfs/053.out delete mode 100755 tests/xfs/137 delete mode 100644 tests/xfs/137.out delete mode 100755 tests/xfs/138 delete mode 100644 tests/xfs/138.out delete mode 100755 tests/xfs/139 delete mode 100644 tests/xfs/139.out delete mode 100755 tests/xfs/140 delete mode 100644 tests/xfs/140.out delete mode 100755 tests/xfs/179 delete mode 100644 tests/xfs/179.out delete mode 100755 tests/xfs/180 delete mode 100644 tests/xfs/180.out delete mode 100755 tests/xfs/182 delete mode 100644 tests/xfs/182.out delete mode 100755 tests/xfs/200 delete mode 100644 tests/xfs/200.out delete mode 100755 tests/xfs/306 delete mode 100644 tests/xfs/306.out
tests/generic/054 new file +102 -0
@@ -0,0 +1,102 @@ +#! /bin/bash +# FS QA Test No. 054 +# +# Test stale data exposure via writeback using various file allocation +# modification commands. The presumption is that such commands result in partial +# writeback and can convert a delayed allocation extent, that might be larger +# than the ranged affected by fallocate, to a normal extent. If the fs happens +# to crash sometime between when the extent modification is logged and writeback +# occurs for dirty pages within the extent but outside of the fallocated range, +# stale data exposure can occur. +# +#----------------------------------------------------------------------- +# Copyright (c) 2014 Red Hat, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/punch + +# real QA test starts here +rm -f $seqres.full + +_crashtest() +{ + cmd=$1 + img=$SCRATCH_MNT/$seq.img + mnt=$SCRATCH_MNT/$seq.mnt + file=$mnt/file + + # Create an fs on a small, initialized image. The pattern is written to + # the image to detect stale data exposure. + $XFS_IO_PROG -f -c "truncate 0" -c "pwrite 0 25M" $img \ + >> $seqres.full 2>&1 + _mkfs_dev $img >> $seqres.full 2>&1 + + mkdir -p $mnt + _mount $img $mnt + + echo $cmd + + # write, run the test command and shutdown the fs + $XFS_IO_PROG -f -c "pwrite -S 1 0 64k" -c "$cmd 60k 4k" $file | \ + _filter_xfs_io + ./src/godown -f $mnt + + $UMOUNT_PROG $mnt + _mount $img $mnt + + # we generally expect a zero-sized file (this should be silent) + hexdump $file + + $UMOUNT_PROG $mnt +} + +# Modify as appropriate. +_supported_fs generic +_supported_os Linux +_require_scratch +_require_scratch_shutdown +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" +_require_xfs_io_command "fzero" + +_scratch_mkfs >/dev/null 2>&1 +_scratch_mount + +_crashtest "falloc -k" +_crashtest "fpunch" +_crashtest "fzero -k" + +status=0 +exit
tests/generic/054.out new file +10 -0
@@ -0,0 +1,10 @@ +QA output created by 054 +falloc -k +wrote 65536/65536 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +fpunch +wrote 65536/65536 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +fzero -k +wrote 65536/65536 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
tests/generic/137 new file +106 -0
106 lines not on this page · raw message
tests/generic/137.out new file +1 -0
@@ -0,0 +1 @@ +QA output created by 137
tests/generic/138 new file +112 -0
112 lines not on this page · raw message
tests/generic/138.out new file +1 -0
@@ -0,0 +1 @@ +QA output created by 138
tests/generic/139 new file +112 -0
112 lines not on this page · raw message
tests/generic/139.out new file +1 -0
@@ -0,0 +1 @@ +QA output created by 139
tests/generic/140 new file +109 -0
109 lines not on this page · raw message
tests/generic/140.out new file +1 -0
@@ -0,0 +1 @@ +QA output created by 140
tests/generic/179 new file +107 -0
107 lines not on this page · raw message
tests/generic/179.out new file +1 -0
@@ -0,0 +1 @@ +QA output created by 179
tests/generic/180 new file +111 -0
111 lines not on this page · raw message
tests/generic/180.out new file +1 -0
@@ -0,0 +1 @@ +QA output created by 180
tests/generic/182 new file +108 -0
108 lines not on this page · raw message
tests/generic/182.out new file +1 -0
@@ -0,0 +1 @@ +QA output created by 182
tests/generic/200 new file +127 -0
127 lines not on this page · raw message
tests/generic/200.out new file +24 -0
@@ -0,0 +1,24 @@ +QA output created by 200 +setting device read-only +mounting read-only block device: +mount: SCRATCH_DEV is write-protected, mounting read-only +touching file on read-only filesystem (should fail) +touch: cannot touch 'SCRATCH_MNT/foo': Read-only file system +unmounting read-only filesystem +setting device read-write +mounting read-write block device: +touch files +going down: +unmounting shutdown filesystem: +setting device read-only +mounting filesystem that needs recovery on a read-only device: +mount: SCRATCH_DEV is write-protected, mounting read-only +mount: cannot mount SCRATCH_DEV read-only +unmounting read-only filesystem +umount: SCRATCH_MNT: not mounted +mounting filesystem with -o norecovery on a read-only device: +mount: SCRATCH_DEV is write-protected, mounting read-only +unmounting read-only filesystem +setting device read-write +mounting filesystem that needs recovery with -o ro: +*** done
tests/generic/305 new file +105 -0
105 lines not on this page · raw message
tests/generic/305.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 305 +No output is good. Failures are loud.
tests/generic/group +10 -0
@@ -45,6 +45,7 @@ 040 metadata auto quick 041 metadata auto quick 053 acl repair auto quick +054 auto quick rw 062 attr udf auto quick 068 other auto freeze dangerous stress 069 rw udf auto quick
@@ -79,12 +80,20 @@ 132 pattern auto 133 rw auto 135 metadata auto quick +137 metadata log auto +138 metadata log auto +139 metadata log auto +140 metadata log auto 141 rw auto quick 169 rw metadata auto quick +179 metadata rw auto +180 metadata rw auto +182 metadata rw auto 184 metadata auto quick 192 atime auto 193 metadata auto quick 198 auto aio quick +200 mount auto quick 204 metadata rw auto 207 auto aio quick 208 auto aio
@@ -138,6 +147,7 @@ 294 auto quick 299 auto aio enospc rw stress 300 auto aio enospc preallocrw stress +305 auto stress log metadata repair 306 auto quick rw 307 auto quick 308 auto quick
tests/xfs/053 deleted +0 -102
102 lines not on this page · raw message
tests/xfs/053.out deleted +0 -10
@@ -1,10 +0,0 @@ -QA output created by 053 -falloc -k -wrote 65536/65536 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -fpunch -wrote 65536/65536 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -fzero -k -wrote 65536/65536 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
tests/xfs/137 deleted +0 -106
106 lines not on this page · raw message
tests/xfs/137.out deleted +0 -1
@@ -1 +0,0 @@ -QA output created by 137
tests/xfs/138 deleted +0 -112
112 lines not on this page · raw message
tests/xfs/138.out deleted +0 -1
@@ -1 +0,0 @@ -QA output created by 138
tests/xfs/139 deleted +0 -112
112 lines not on this page · raw message
tests/xfs/139.out deleted +0 -1
@@ -1 +0,0 @@ -QA output created by 139
tests/xfs/140 deleted +0 -109
109 lines not on this page · raw message
tests/xfs/140.out deleted +0 -1
@@ -1 +0,0 @@ -QA output created by 140
tests/xfs/179 deleted +0 -107
107 lines not on this page · raw message
tests/xfs/179.out deleted +0 -1
@@ -1 +0,0 @@ -QA output created by 179
tests/xfs/180 deleted +0 -111
111 lines not on this page · raw message
tests/xfs/180.out deleted +0 -1
@@ -1 +0,0 @@ -QA output created by 180
tests/xfs/182 deleted +0 -108
108 lines not on this page · raw message
tests/xfs/182.out deleted +0 -1
@@ -1 +0,0 @@ -QA output created by 182
tests/xfs/200 deleted +0 -127
127 lines not on this page · raw message
tests/xfs/200.out deleted +0 -24
@@ -1,24 +0,0 @@ -QA output created by 200 -setting device read-only -mounting read-only block device: -mount: SCRATCH_DEV is write-protected, mounting read-only -touching file on read-only filesystem (should fail) -touch: cannot touch 'SCRATCH_MNT/foo': Read-only file system -unmounting read-only filesystem -setting device read-write -mounting read-write block device: -touch files -going down: -unmounting shutdown filesystem: -setting device read-only -mounting filesystem that needs recovery on a read-only device: -mount: SCRATCH_DEV is write-protected, mounting read-only -mount: cannot mount SCRATCH_DEV read-only -unmounting read-only filesystem -umount: SCRATCH_MNT: not mounted -mounting filesystem with -o norecovery on a read-only device: -mount: SCRATCH_DEV is write-protected, mounting read-only -unmounting read-only filesystem -setting device read-write -mounting filesystem that needs recovery with -o ro: -*** done
tests/xfs/306 deleted +0 -105
105 lines not on this page · raw message
tests/xfs/306.out deleted +0 -2
@@ -1,2 +0,0 @@ -QA output created by 306 -No output is good. Failures are loud.
tests/xfs/group +0 -10
@@ -50,7 +50,6 @@ 050 quota auto quick 051 auto log metadata 052 quota db auto quick -053 auto quick rw 054 quota auto quick 055 dump ioctl remote tape 056 dump ioctl auto quick
@@ -99,10 +98,6 @@ 122 other auto quick 134 quota auto quick 136 attr2 -137 metadata log auto -138 metadata log auto -139 metadata log auto -140 metadata log auto 142 dmapi 143 dmapi 144 dmapi
@@ -139,10 +134,7 @@ 176 dmapi 177 dmapi 178 mkfs other auto -179 metadata rw auto -180 metadata rw auto 181 log auto quick -182 metadata rw auto 183 rw other auto quick 185 dmapi 186 attr auto quick
@@ -156,7 +148,6 @@ 196 quota auto quick 197 dir auto quick 199 mount auto quick -200 mount auto quick 201 metadata auto quick 202 repair auto quick 203 ioctl auto
@@ -201,4 +192,3 @@ 303 auto quick quota 304 auto quick quota 305 auto quota -306 auto stress log metadata repair
Signature · 1 line
2.1.1
Re: [PATCH 5/8 v4] tests/generic: relocate xfs's tests into tests/generic/
Quoted 12 lines · Jaegeuk Kim
This patch moves the generic testcases defined in xfs into tests/generic/.
* xfs/053 -> generic/054
xfs/137 -> generic/137
xfs/138 -> generic/138
xfs/139 -> generic/139
xfs/140 -> generic/140
xfs/179 -> generic/179
xfs/180 -> generic/180
xfs/182 -> generic/182
xfs/200 -> generic/200
* xfs/306 -> generic/305
Quoted 1 line
* The test number was changed to address conflicts.
Just rename them all to the lowest unused numbers in the generic/ test directory.
Quoted 4 lines
Signed-off-by Jaegeuk Kim <[email protected]>--- tests/generic/054 | 102 ++++++++++++++++++++++++++++++++++++++++ tests/generic/054.out | 10 ++++
You should tell git to use a diff format that track renames. i.e
$ git diff -M 97bf6af..2155355
fs/xfs/libxfs/xfs_fs.h renamed from fs/xfs/xfs_fs.h +0 -0
$
$
$ git diff --stat -M 97bf6af..2155355
fs/xfs/{ => libxfs}/xfs_fs.h | 0
1 file changed, 0 insertions(+), 0 deletions(-)
$It's much easier to review rename patches in this format. :)
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH v4 6/8 common/rc: define dump.f2fs and logstate for f2fs
In reply to Jaegeuk KimThis patch defines dump.f2fs and logstate for f2fs's clean and dirty logs. And, also it adds _link_out_file_fs to specify output according to filesystem.
--- common/config | 1 + common/log | 20 +++++++++++++++++--- common/rc | 22 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-)
common/config +1 -0
@@ -221,6 +221,7 @@ case "$HOSTOS" in export MKFS_UDF_PROG="`set_prog_path mkudffs`" export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`" export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`" + export DUMP_F2FS_PROG="`set_prog_path dump.f2fs`" export BMAP_F2FS_PROG="`set_prog_path fibmap.f2fs`" export BTRFS_UTIL_PROG="`set_prog_path btrfs`" export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"
common/log +17 -3
@@ -218,11 +218,25 @@ _check_log() _print_logstate() { - _scratch_xfs_logprint -t | tee -a $seqres.full >$tmp.logprint - if grep -q "<DIRTY>" $tmp.logprint; then + case "$FSTYP" in + xfs) + _scratch_xfs_logprint -t | tee -a $seqres.full >$tmp.logprint + DIRTY="<DIRTY>" + CLEAN="<CLEAN>" + ;; + f2fs) + _scratch_f2fs_logprint | tee -a $seqres.full >$tmp.logprint + DIRTY="sudden-power-off" + CLEAN="unmount" + ;; + *) + ;; + esac + + if grep -q $DIRTY $tmp.logprint; then echo "dirty log" fi - if grep -q "<CLEAN>" $tmp.logprint; then + if grep -q $CLEAN $tmp.logprint; then echo "clean log" fi }
common/rc +22 -0
@@ -770,6 +770,11 @@ _scratch_xfs_repair() $XFS_REPAIR_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV } +_scratch_f2fs_logprint() +{ + $DUMP_F2FS_PROG $SCRATCH_DEV +} + _get_pids_by_name() { if [ $# -ne 1 ]
@@ -2091,6 +2096,16 @@ _link_out_file() fi } +_link_out_file_fs() +{ + if [ -z "$1" -o -z "$2" ]; then + echo Error must pass src and dst. + exit + fi + rm -f $2 + ln -s $1.$FSTYP $2 +} + _die() { echo $@
@@ -2435,6 +2450,13 @@ _require_dumpe2fs() fi } +_require_dumpf2fs() +{ + if [ -z "$DUMP_F2FS_PROG" ]; then + _notrun "This test requires dump.f2fs utility." + fi +} + _require_ugid_map() { if [ ! -e /proc/self/uid_map ]; then
Signature · 1 line
2.1.1
Re: [PATCH 6/8 v4] common/rc: define dump.f2fs and logstate for f2fs
Quoted 44 lines · Jaegeuk Kim
This patch defines dump.f2fs and logstate for f2fs's clean and dirty logs. And, also it adds
_link_out_file_fsto specify output according to filesystem.Signed-off-by Jaegeuk Kim <[email protected]>--- common/config | 1 + common/log | 20 +++++++++++++++++--- common/rc | 22 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-)common/config +1
-0@@ -221,6 +221,7 @@ case "$HOSTOS" in export MKFS_UDF_PROG="`set_prog_path mkudffs`" export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`" export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`" + export DUMP_F2FS_PROG="`set_prog_path dump.f2fs`" export BMAP_F2FS_PROG="`set_prog_path fibmap.f2fs`" export BTRFS_UTIL_PROG="`set_prog_path btrfs`" export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"common/log +12
-2@@ -218,11 +218,25 @@ _check_log() _print_logstate() { - _scratch_xfs_logprint -t | tee -a $seqres.full >$tmp.logprint - if grep -q "<DIRTY>" $tmp.logprint; then + case "$FSTYP" in + xfs) + _scratch_xfs_logprint -t | tee -a $seqres.full >$tmp.logprint + DIRTY="<DIRTY>" + CLEAN="<CLEAN>" + ;; + f2fs) + _scratch_f2fs_logprint | tee -a $seqres.full >$tmp.logprint + DIRTY="sudden-power-off" + CLEAN="unmount" + ;; + *)
common/log _check_log() · line 241
Quoted 10 lines
common/log +5
-1+ ;; + esac + + if grep -q $DIRTY $tmp.logprint; then echo "dirty log" fi - if grep -q "<CLEAN>" $tmp.logprint; then + if grep -q $CLEAN $tmp.logprint; then echo "clean log" fi
The only output from this function is "clean log" or "dirty log".
so:
_scratch_xfs_logstate()
{
_scratch_xfs_logprint -t | tee -a $seqres.full | grep -q "<CLEAN>"
echo $?
}_scratch_f2fs_logstate()
{
$DUMP_F2FS_PROG $SCRATCH_DEV | tee -a $seqres.full | grep -q "unmount"
echo $?
}_print_logstate()
{
case "$FSTYP" in
xfs)
dirty=$(_scratch_xfs_logstate)
;;
f2fs)
dirty=$(_scratch_f2fs_logstate)
;;
*)
;;
esac
if [ $dirty -ne 0 ]; then
echo "dirty log"
else
echo "clean log"
fi
}common/log _check_log()
Quoted 9 lines
common/log +9
-0+_link_out_file_fs() +{ + if [ -z "$1" -o -z "$2" ]; then + echo Error must pass src and dst. + exit + fi + rm -f $2 + ln -s $1.$FSTYP $2 +}
Not sure why this is necessary, but I'll point that out where it is used.
Quoted 5 lines
common/log +1
-0+ _die() { echo $@
common/log _require_dumpe2fs() · line 2458
Quoted 9 lines
common/log +6
-0@@ -2435,6 +2450,13 @@ _require_dumpe2fs() fi } +_require_dumpf2fs() +{ + if [ -z "$DUMP_F2FS_PROG" ]; then + _notrun "This test requires dump.f2fs utility." + fi +}
Actually, I'd make that
_require_logstate()
{
case "$FSTYP" in
xfs)
if [ -z "$XFS_LOGPRINT_PROG" ]; then
_notrun "This test requires xfs_logprint utility."
fi
f2fs)
if [ -z "$DUMP_F2FS_PROG" ]; then
_notrun "This test requires dump.f2fs utility."
fi
;;
*)
_notrun "$FSTYP does not support log state probing."
;;
esac
}Quoted 8 lines
common/log +1
-0+ _require_ugid_map() { if [ ! -e /proc/self/uid_map ]; thenSignature · 1 line
2.1.1
Signature · 2 lines
Dave Chinner [email protected]
PATCH v4 7/8 tests/xfs: add f2fs testcase and convert them being generic
In reply to Jaegeuk KimThis patch changes the following xfs's testcases to be generic ones by adding f2fs support.
xfs/051
xfs/085
xfs/086
xfs/087
--- tests/xfs/051 | 18 +- tests/xfs/085 | 9 +- tests/xfs/086 | 34 +- tests/xfs/086.out | 4722 ------------------------------------------------ tests/xfs/086.out.f2fs | 3306 +++++++++++++++++++++++++++++++++ tests/xfs/086.out.xfs | 4722 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/087 | 58 +- tests/xfs/087.out | 389 ---- tests/xfs/087.out.f2fs | 303 ++++ tests/xfs/087.out.xfs | 389 ++++ 10 files changed, 8812 insertions(+), 5138 deletions(-) delete mode 100644 tests/xfs/086.out create mode 100644 tests/xfs/086.out.f2fs create mode 100644 tests/xfs/086.out.xfs delete mode 100644 tests/xfs/087.out create mode 100644 tests/xfs/087.out.f2fs create mode 100644 tests/xfs/087.out.xfs
tests/xfs/051 +13 -5
@@ -45,16 +45,20 @@ _cleanup() . ./common/dmflakey # Modify as appropriate. -_supported_fs xfs +_supported_fs generic _supported_os Linux _require_scratch +_require_scratch_shutdown _require_dm_flakey -_require_xfs_sysfs debug/log_recovery_delay + +if [ "$FSTYP" == "xfs" ]; then + _require_xfs_sysfs debug/log_recovery_delay +fi echo "Silence is golden." -_scratch_mkfs_xfs >/dev/null 2>&1 +_scratch_mkfs >/dev/null 2>&1 _scratch_mount # Start a workload and shutdown the fs. The subsequent mount will require log
@@ -76,13 +80,17 @@ _load_flakey_table $FLAKEY_ALLOW_WRITES # initial writes to proceed (e.g., stale log block reset) and then let the # flakey uptime timer expire such that I/Os will fail by the time log recovery # starts. -echo 10 > /sys/fs/xfs/debug/log_recovery_delay +if [ "$FSTYP" == "xfs" ]; then + echo 10 > /sys/fs/xfs/debug/log_recovery_delay +fi # The mount should fail due to dm-flakey. Note that this is dangerous on kernels # without the xfs_buf log recovery race fixes. _mount_flakey > /dev/null 2>&1 -echo 0 > /sys/fs/xfs/debug/log_recovery_delay +if [ "$FSTYP" == "xfs" ]; then + echo 0 > /sys/fs/xfs/debug/log_recovery_delay +fi _cleanup_flakey
tests/xfs/085 +7 -2
@@ -40,16 +40,21 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 . ./common/log # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os IRIX Linux rm -f $seqres.full rm -f $tmp.log _require_scratch +_require_scratch_shutdown + +if [ "$FSTYP" == "f2fs" ]; then + _require_dumpf2fs +fi echo "mkfs" -_scratch_mkfs_xfs >>$seqres.full 2>&1 \ +_scratch_mkfs >>$seqres.full 2>&1 \ || _fail "mkfs scratch failed" echo "mount"
tests/xfs/086 +30 -4
@@ -24,6 +24,7 @@ #----------------------------------------------------------------------- # +seqfull=$0 seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq"
@@ -39,17 +40,28 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 . ./common/log # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os IRIX Linux rm -f $seqres.full $tmp.* _require_scratch -_require_v2log +_require_scratch_shutdown + +case "$FSTYP" in + xfs) + _require_v2log + ;; + f2fs) + _require_dumpf2fs +esac + +# link correct .out file +_link_out_file_fs $seq.out $seqfull.out echo "*** init FS" umount $SCRATCH_DEV >/dev/null 2>&1 -cat >$tmp.seq.params <<EOF +cat >$tmp.seq.params.xfs <<EOF # mkfs-opt mount-opt # ------------------------------ version=2 logbsize=32k
@@ -64,6 +76,20 @@ cat >$tmp.seq.params <<EOF version=2,su=256k logbsize=256k EOF +cat >$tmp.seq.params.f2fs <<EOF +# mkfs-opt mount-opt +# --------------------------- + test1 active_logs=6,background_gc=off + test2 active_logs=6,background_gc=off,inline_data + test3 active_logs=6,background_gc=off,inline_dentry + test4 active_logs=6,background_gc=off,inline_dentry,inline_data + test5 active_logs=6,background_gc=off,disable_roll_forward + test6 active_logs=4,background_gc=off + test7 active_logs=2,background_gc=off +EOF + +cat $tmp.seq.params.$FSTYP > $tmp.seq.params + # Do the work for various log params which # should not effect the data content of the log # Try with and without sync'ing - sync'ing will mean that
@@ -84,7 +110,7 @@ for s in sync nosync ; do # mkfs the FS _echofull "mkfs" - _scratch_mkfs_xfs >>$seqres.full 2>&1 + _scratch_mkfs >>$seqres.full 2>&1 if [ $? -ne 0 ] ; then _echofull "mkfs failed: $MKFS_OPTIONS" continue
tests/xfs/086.out deleted +0 -4722
2,869 lines not on this page · raw message
tests/xfs/086.out.f2fs new file +3306 -0
3,306 lines not on this page · raw message
tests/xfs/086.out.xfs new file +4722 -0
4,722 lines not on this page · raw message
tests/xfs/087 +42 -16
58 lines not on this page · raw message
tests/xfs/087.out deleted +0 -389
389 lines not on this page · raw message
tests/xfs/087.out.f2fs new file +303 -0
303 lines not on this page · raw message
tests/xfs/087.out.xfs new file +389 -0
389 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.1.1
Part of the diff is not shown here. View the raw message.
Re: [PATCH 7/8 v4] tests/xfs: add f2fs testcase and convert them being generic
Quoted 38 lines · Jaegeuk Kim
This patch changes the following xfs's testcases to be generic ones by adding f2fs support.
xfs/051
xfs/085
xfs/086
xfs/087Signed-off-by Jaegeuk Kim <[email protected]>--- tests/xfs/051 | 18 +- tests/xfs/085 | 9 +- tests/xfs/086 | 34 +- tests/xfs/086.out | 4722 ------------------------------------------------ tests/xfs/086.out.f2fs | 3306 +++++++++++++++++++++++++++++++++ tests/xfs/086.out.xfs | 4722 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/087 | 58 +- tests/xfs/087.out | 389 ---- tests/xfs/087.out.f2fs | 303 ++++ tests/xfs/087.out.xfs | 389 ++++ 10 files changed, 8812 insertions(+), 5138 deletions(-) delete mode 100644 tests/xfs/086.out create mode 100644 tests/xfs/086.out.f2fs create mode 100644 tests/xfs/086.out.xfs delete mode 100644 tests/xfs/087.out create mode 100644 tests/xfs/087.out.f2fs create mode 100644 tests/xfs/087.out.xfstests/xfs/051 +1
-1@@ -45,16 +45,20 @@ _cleanup() . ./common/dmflakey # Modify as appropriate. -_supported_fs xfs +_supported_fs generic
tests/xfs/051 _cleanup() · line 57
Quoted 10 lines
tests/xfs/051 +5
-1_supported_os Linux _require_scratch +_require_scratch_shutdown _require_dm_flakey -_require_xfs_sysfs debug/log_recovery_delay + +if [ "$FSTYP" == "xfs" ]; then + _require_xfs_sysfs debug/log_recovery_delay +fi
Really, this is an XFS specific test unless you can reliably trigger IO errors in the middle of log recovery. Otherwise you aren't actually testing what the regression test is actually trying to cover.
Quoted 11 lines
tests/xfs/085 +1
-1@@ -40,16 +40,21 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 . ./common/log # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os IRIX Linux
tests/xfs/085 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 · line 54
Quoted 10 lines
tests/xfs/085 +5
-0rm -f $seqres.full rm -f $tmp.log _require_scratch +_require_scratch_shutdown + +if [ "$FSTYP" == "f2fs" ]; then + _require_dumpf2fs +fi
_require_logstate, as per comments in the previous patch.
tests/xfs/085 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 · line 58
Quoted 5 lines
tests/xfs/085 +1
-1echo "mkfs" -_scratch_mkfs_xfs >>$seqres.full 2>&1 \ +_scratch_mkfs >>$seqres.full 2>&1 \ || _fail "mkfs scratch failed"
We don't need to catch failure here, and it needs to be done before the shutdown require....
Quoted 23 lines
tests/xfs/085 +0
-0echo "mount"tests/xfs/086 +2
-1@@ -24,6 +24,7 @@ #----------------------------------------------------------------------- # +seqfull=$0 seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq"@@ -39,17 +40,28 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 . ./common/log # real QA test starts here -_supported_fs xfs +_supported_fs generic _supported_os IRIX Linux rm -f $seqres.full $tmp.* _require_scratch
tests/xfs/086 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 · line 56
Quoted 10 lines
tests/xfs/086 +9
-1-_require_v2log +_require_scratch_shutdown + +case "$FSTYP" in + xfs) + _require_v2log + ;; + f2fs) + _require_dumpf2fs +esac
It's pretty safe to make this _require_logstate() - v2 log support has been around long enough with XFS that we probably don't need to test for it anymore.
tests/xfs/086 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 · line 58
Quoted 2 lines
tests/xfs/086 +2
-0+# link correct .out file +_link_out_file_fs $seq.out $seqfull.out
I don't think we need multiple output files.
Quoted 15 lines
tests/xfs/086 +4
-1echo "*** init FS" umount $SCRATCH_DEV >/dev/null 2>&1 -cat >$tmp.seq.params <<EOF +cat >$tmp.seq.params.xfs <<EOF # mkfs-opt mount-opt # ------------------------------ version=2 logbsize=32k@@ -64,6 +76,20 @@ cat >$tmp.seq.params <<EOF version=2,su=256k logbsize=256k EOF +cat >$tmp.seq.params.f2fs <<EOF +# mkfs-opt mount-opt +# ---------------------------
tests/xfs/086 cat >$tmp.seq.params <<EOF · line 91
Quoted 10 lines
tests/xfs/086 +10
-0+ test1 active_logs=6,background_gc=off + test2 active_logs=6,background_gc=off,inline_data + test3 active_logs=6,background_gc=off,inline_dentry + test4 active_logs=6,background_gc=off,inline_dentry,inline_data + test5 active_logs=6,background_gc=off,disable_roll_forward + test6 active_logs=4,background_gc=off + test7 active_logs=2,background_gc=off +EOF + +cat $tmp.seq.params.$FSTYP > $tmp.seq.params
_get_log_configs > $tmp.seq.params
And wrap the log configuration dump into fs specific functions somewhere. e.g. common/log
Also, it needs to have the same number of options in the table as the XFS log option table. If you do that, then with one minor tweak (below) we don't need filesystem specific golden output files.
Quoted 18 lines
tests/xfs/086 +1
-1# Do the work for various log params which # should not effect the data content of the log # Try with and without sync'ing - sync'ing will mean that@@ -84,7 +110,7 @@ for s in sync nosync ; do # mkfs the FS _echofull "mkfs" - _scratch_mkfs_xfs >>$seqres.full 2>&1 + _scratch_mkfs >>$seqres.full 2>&1 if [ $? -ne 0 ] ; then _echofull "mkfs failed: $MKFS_OPTIONS" continuetests/xfs/086.out deleted +0
-0
tests/xfs/086.out line 3
Quoted 3 lines
tests/xfs/086.out deleted +0
-3@@ -1,4722 +0,0 @@ -QA output created by 086 -*** init FS ---- mkfs=version=2, mnt=logbsize=32k, sync=sync ---
This is the only output in the golden image file that changes between xfs and f2fs. It doesn't need to be in the golden output file - it can just be dumped in the $seqres.full file.
Similar changes can be made to 087 as well.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH v4 8/8 tests/generic: relocate four xfs's tests into tests/generic/
In reply to Jaegeuk KimThis patch moves the generic testcases defined in xfs into tests/generic/.
xfs/051 -> generic/051
xfs/085 -> generic/085
xfs/086 -> generic/086
xfs/087 -> generic/087
--- tests/generic/051 | 103 + tests/generic/051.out | 2 + tests/generic/085 | 98 + tests/generic/085.out | 113 ++ tests/generic/086 | 178 ++ tests/generic/086.out.f2fs | 3306 +++++++++++++++++++++++++++++++ tests/generic/086.out.xfs | 4722 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/087 | 179 ++ tests/generic/087.out.f2fs | 303 +++ tests/generic/087.out.xfs | 389 ++++ tests/generic/group | 4 + tests/xfs/051 | 103 - tests/xfs/051.out | 2 - tests/xfs/085 | 98 - tests/xfs/085.out | 113 -- tests/xfs/086 | 178 -- tests/xfs/086.out.f2fs | 3306 ------------------------------- tests/xfs/086.out.xfs | 4722 -------------------------------------------- tests/xfs/087 | 179 -- tests/xfs/087.out.f2fs | 303 --- tests/xfs/087.out.xfs | 389 ---- tests/xfs/group | 4 - 22 files changed, 9397 insertions(+), 9397 deletions(-) create mode 100755 tests/generic/051 create mode 100644 tests/generic/051.out create mode 100755 tests/generic/085 create mode 100644 tests/generic/085.out create mode 100755 tests/generic/086 create mode 100644 tests/generic/086.out.f2fs create mode 100644 tests/generic/086.out.xfs create mode 100755 tests/generic/087 create mode 100644 tests/generic/087.out.f2fs create mode 100644 tests/generic/087.out.xfs delete mode 100755 tests/xfs/051 delete mode 100644 tests/xfs/051.out delete mode 100755 tests/xfs/085 delete mode 100644 tests/xfs/085.out delete mode 100755 tests/xfs/086 delete mode 100644 tests/xfs/086.out.f2fs delete mode 100644 tests/xfs/086.out.xfs delete mode 100755 tests/xfs/087 delete mode 100644 tests/xfs/087.out.f2fs delete mode 100644 tests/xfs/087.out.xfs
tests/generic/051 new file +103 -0
@@ -0,0 +1,103 @@ +#! /bin/bash +# FS QA Test No. 051 +# +# Simulate a buffer use after free race in XFS log recovery. The race triggers +# on I/O failures during log recovery. Note that this test is dangerous as it +# causes BUG() errors or a panic. +# +#----------------------------------------------------------------------- +# Copyright (c) 2013 Oracle, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* + killall -9 $FSSTRESS_PROG > /dev/null 2>&1 + _scratch_unmount > /dev/null 2>&1 +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/dmflakey + +# Modify as appropriate. +_supported_fs generic +_supported_os Linux + +_require_scratch +_require_scratch_shutdown +_require_dm_flakey + +if [ "$FSTYP" == "xfs" ]; then + _require_xfs_sysfs debug/log_recovery_delay +fi + +echo "Silence is golden." + +_scratch_mkfs >/dev/null 2>&1 +_scratch_mount + +# Start a workload and shutdown the fs. The subsequent mount will require log +# recovery. +$FSSTRESS_PROG -n 9999 -p 2 -w -d $SCRATCH_MNT > /dev/null 2>&1 & +sleep 5 +src/godown -f $SCRATCH_MNT +killall -q $FSSTRESS_PROG +wait +_scratch_unmount + +# Initialize a dm-flakey device that will pass I/Os for 5s and fail thereafter. +_init_flakey +BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` +FLAKEY_TABLE="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 5 180" +_load_flakey_table $FLAKEY_ALLOW_WRITES + +# Set a 10s log recovery delay and mount the flakey device. This should allow +# initial writes to proceed (e.g., stale log block reset) and then let the +# flakey uptime timer expire such that I/Os will fail by the time log recovery +# starts. +if [ "$FSTYP" == "xfs" ]; then + echo 10 > /sys/fs/xfs/debug/log_recovery_delay +fi + +# The mount should fail due to dm-flakey. Note that this is dangerous on kernels +# without the xfs_buf log recovery race fixes. +_mount_flakey > /dev/null 2>&1 + +if [ "$FSTYP" == "xfs" ]; then + echo 0 > /sys/fs/xfs/debug/log_recovery_delay +fi + +_cleanup_flakey + +# replay the log +_scratch_mount +_scratch_unmount + +# success, all done +status=0 +exit
tests/generic/051.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 051 +Silence is golden.
tests/generic/085 new file +98 -0
98 lines not on this page · raw message
tests/generic/085.out new file +113 -0
113 lines not on this page · raw message
tests/generic/086 new file +178 -0
178 lines not on this page · raw message
tests/generic/086.out.f2fs new file +3306 -0
2,506 lines not on this page · raw message
tests/generic/086.out.xfs new file +4722 -0
4,722 lines not on this page · raw message
tests/generic/087 new file +179 -0
179 lines not on this page · raw message
tests/generic/087.out.f2fs new file +303 -0
303 lines not on this page · raw message
tests/generic/087.out.xfs new file +389 -0
389 lines not on this page · raw message
tests/xfs/051 deleted +0 -103
103 lines not on this page · raw message
tests/xfs/085 deleted +0 -98
98 lines not on this page · raw message
tests/xfs/085.out deleted +0 -113
113 lines not on this page · raw message
tests/xfs/086 deleted +0 -178
178 lines not on this page · raw message
tests/xfs/086.out.f2fs deleted +0 -3306
3,306 lines not on this page · raw message
tests/xfs/086.out.xfs deleted +0 -4722
4,722 lines not on this page · raw message
tests/xfs/087 deleted +0 -179
179 lines not on this page · raw message
tests/xfs/087.out.f2fs deleted +0 -303
303 lines not on this page · raw message
tests/xfs/087.out.xfs deleted +0 -389
389 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 9 lines
2.1.1 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
Part of the diff is not shown here. View the raw message.