Dump log cleanups
cover Dump log cleanups
Hi all,
This cleanup set is a followup to the log attribute replay test that was posted here:
https://lore.kernel.org/linux-xfs/[email protected]/
This set renames the *_inject_logprint functions to *_remount_dump_log and moves them to common/xfs.
Questions and feedback are appreciated!
Catherine
Catherine Hoang (3):
xfstests: Rename _scratch_inject_logprint to _scratch_remount_dump_log
xfstests: Rename _test_inject_logprint to _test_remount_dump_log
xfstests: Move *_dump_log routines to common/xfs
common/inject | 26 -------------------------- common/xfs | 26 ++++++++++++++++++++++++++ tests/xfs/312 | 2 +- tests/xfs/313 | 2 +- tests/xfs/314 | 2 +- tests/xfs/315 | 2 +- tests/xfs/316 | 2 +- tests/xfs/317 | 2 +- tests/xfs/318 | 2 +- tests/xfs/319 | 2 +- tests/xfs/320 | 2 +- tests/xfs/321 | 2 +- tests/xfs/322 | 2 +- tests/xfs/323 | 2 +- tests/xfs/324 | 2 +- tests/xfs/325 | 2 +- tests/xfs/326 | 2 +- tests/xfs/329 | 2 +- 18 files changed, 42 insertions(+), 42 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/3 xfstests: Rename _scratch_inject_logprint to _scratch_remount_dump_log
Rename _scratch_inject_logprint to _scratch_remount_dump_log to better describe what this function does. _scratch_remount_dump_log unmounts and remounts the scratch device, dumping the log.
--- common/inject | 2 +- tests/xfs/312 | 2 +- tests/xfs/313 | 2 +- tests/xfs/314 | 2 +- tests/xfs/315 | 2 +- tests/xfs/316 | 2 +- tests/xfs/317 | 2 +- tests/xfs/318 | 2 +- tests/xfs/319 | 2 +- tests/xfs/320 | 2 +- tests/xfs/321 | 2 +- tests/xfs/322 | 2 +- tests/xfs/323 | 2 +- tests/xfs/324 | 2 +- tests/xfs/325 | 2 +- tests/xfs/326 | 2 +- tests/xfs/329 | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-)
common/inject +1 -1
@@ -113,7 +113,7 @@ _scratch_inject_error() } # Unmount and remount the scratch device, dumping the log -_scratch_inject_logprint() +_scratch_remount_dump_log() { local opts="$1"
tests/xfs/312 +1 -1
@@ -63,7 +63,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfs
tests/xfs/313 +1 -1
@@ -63,7 +63,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfs
tests/xfs/314 +1 -1
@@ -64,7 +64,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfs
tests/xfs/315 +1 -1
@@ -61,7 +61,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfs
tests/xfs/316 +1 -1
@@ -61,7 +61,7 @@ echo "CoW all the blocks" $XFS_IO_PROG -c "pwrite -W -S 0x67 -b $sz 0 $((blks * blksz))" $SCRATCH_MNT/file2 >> $seqres.full echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfs
tests/xfs/317 +1 -1
@@ -54,7 +54,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "Check files" md5sum $SCRATCH_MNT/file0 | _filter_scratch
tests/xfs/318 +1 -1
@@ -60,7 +60,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "Check files" md5sum $SCRATCH_MNT/file1 2>&1 | _filter_scratch
tests/xfs/319 +1 -1
@@ -57,7 +57,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfs
tests/xfs/320 +1 -1
@@ -55,7 +55,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/321 +1 -1
@@ -55,7 +55,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/322 +1 -1
@@ -56,7 +56,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/323 +1 -1
@@ -55,7 +55,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfs
tests/xfs/324 +1 -1
@@ -61,7 +61,7 @@ echo "Reflink all the blocks" _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file4 echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfs
tests/xfs/325 +1 -1
@@ -59,7 +59,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfs
tests/xfs/326 +1 -1
@@ -71,7 +71,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfs
tests/xfs/329 +1 -1
@@ -52,7 +52,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" | tee /dev/ttyprintk -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full new_nextents=$(_count_extents $testdir/file1) echo "Check extent count" | tee /dev/ttyprintk
Signature · 1 line
2.25.1
Re: [PATCH 1/3] xfstests: Rename _scratch_inject_logprint to _scratch_remount_dump_log
Quoted 5 lines · Catherine Hoang
Rename
_scratch_inject_logprintto_scratch_remount_dump_logto better describe what this function does._scratch_remount_dump_logunmounts and remounts the scratch device, dumping the log.Signed-off-by Catherine Hoang <[email protected]>
Looks good to me.
Quoted 242 lines
--- common/inject | 2 +- tests/xfs/312 | 2 +- tests/xfs/313 | 2 +- tests/xfs/314 | 2 +- tests/xfs/315 | 2 +- tests/xfs/316 | 2 +- tests/xfs/317 | 2 +- tests/xfs/318 | 2 +- tests/xfs/319 | 2 +- tests/xfs/320 | 2 +- tests/xfs/321 | 2 +- tests/xfs/322 | 2 +- tests/xfs/323 | 2 +- tests/xfs/324 | 2 +- tests/xfs/325 | 2 +- tests/xfs/326 | 2 +- tests/xfs/329 | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-)common/inject +1
-1@@ -113,7 +113,7 @@ _scratch_inject_error() } # Unmount and remount the scratch device, dumping the log -_scratch_inject_logprint() +_scratch_remount_dump_log() { local opts="$1"tests/xfs/312 +1
-1@@ -63,7 +63,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfstests/xfs/313 +1
-1@@ -63,7 +63,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfstests/xfs/314 +1
-1@@ -64,7 +64,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfstests/xfs/315 +1
-1@@ -61,7 +61,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfstests/xfs/316 +1
-1@@ -61,7 +61,7 @@ echo "CoW all the blocks" $XFS_IO_PROG -c "pwrite -W -S 0x67 -b $sz 0 $((blks * blksz))" $SCRATCH_MNT/file2 >> $seqres.full echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfstests/xfs/317 +1
-1@@ -54,7 +54,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "Check files" md5sum $SCRATCH_MNT/file0 | _filter_scratchtests/xfs/318 +1
-1@@ -60,7 +60,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "Check files" md5sum $SCRATCH_MNT/file1 2>&1 | _filter_scratchtests/xfs/319 +1
-1@@ -57,7 +57,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfstests/xfs/320 +1
-1@@ -55,7 +55,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratchtests/xfs/321 +1
-1@@ -55,7 +55,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratchtests/xfs/322 +1
-1@@ -56,7 +56,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratchtests/xfs/323 +1
-1@@ -55,7 +55,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfstests/xfs/324 +1
-1@@ -61,7 +61,7 @@ echo "Reflink all the blocks" _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file4 echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfstests/xfs/325 +1
-1@@ -59,7 +59,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfstests/xfs/326 +1
-1@@ -71,7 +71,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full echo "FS should be online, touch should succeed" touch $SCRATCH_MNT/goodfstests/xfs/329 +1
-1@@ -52,7 +52,7 @@ echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch echo "Remount to replay log" | tee /dev/ttyprintk -_scratch_inject_logprint >> $seqres.full +_scratch_remount_dump_log >> $seqres.full new_nextents=$(_count_extents $testdir/file1) echo "Check extent count" | tee /dev/ttyprintk
PATCH 2/3 xfstests: Rename _test_inject_logprint to _test_remount_dump_log
In reply to Catherine HoangRename _test_inject_logprint to _test_remount_dump_log to better describe what this function does. _test_remount_dump_log unmounts and remounts the test device, dumping the log.
--- common/inject | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/inject +1 -1
@@ -126,7 +126,7 @@ _scratch_remount_dump_log() } # Unmount and remount the test device, dumping the log -_test_inject_logprint() +_test_remount_dump_log() { local opts="$1"
Signature · 1 line
2.25.1
Re: [PATCH 2/3] xfstests: Rename _test_inject_logprint to _test_remount_dump_log
Quoted 5 lines · Catherine Hoang
Rename
_test_inject_logprintto_test_remount_dump_logto better describe what this function does._test_remount_dump_logunmounts and remounts the test device, dumping the log.Signed-off-by Catherine Hoang <[email protected]>
I notice this function has no callers, but I think it's a good utility function to keep around. I think it looks ok.
Quoted 18 lines
--- common/inject | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/inject +1
-1@@ -126,7 +126,7 @@ _scratch_remount_dump_log() } # Unmount and remount the test device, dumping the log -_test_inject_logprint() +_test_remount_dump_log() { local opts="$1"
PATCH 3/3 xfstests: Move *_dump_log routines to common/xfs
In reply to Catherine HoangMove _scratch_remount_dump_log and _test_remount_dump_log from common/inject to common/xfs. These routines do not inject errors and should be placed with other xfs common functions.
--- common/inject | 26 -------------------------- common/xfs | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-)
common/inject +0 -26
@@ -111,29 +111,3 @@ _scratch_inject_error() _fail "Cannot inject error ${type} value ${value}." fi } - -# Unmount and remount the scratch device, dumping the log -_scratch_remount_dump_log() -{ - local opts="$1" - - if test -n "$opts"; then - opts="-o $opts" - fi - _scratch_unmount - _scratch_dump_log - _scratch_mount "$opts" -} - -# Unmount and remount the test device, dumping the log -_test_remount_dump_log() -{ - local opts="$1" - - if test -n "$opts"; then - opts="-o $opts" - fi - _test_unmount - _test_dump_log - _test_mount "$opts" -}
common/xfs +26 -0
@@ -1263,3 +1263,29 @@ _require_scratch_xfs_bigtime() _notrun "bigtime feature not advertised on mount?" _scratch_unmount } + +# Unmount and remount the scratch device, dumping the log +_scratch_remount_dump_log() +{ + local opts="$1" + + if test -n "$opts"; then + opts="-o $opts" + fi + _scratch_unmount + _scratch_dump_log + _scratch_mount "$opts" +} + +# Unmount and remount the test device, dumping the log +_test_remount_dump_log() +{ + local opts="$1" + + if test -n "$opts"; then + opts="-o $opts" + fi + _test_unmount + _test_dump_log + _test_mount "$opts" +}
Signature · 1 line
2.25.1
Re: [PATCH 3/3] xfstests: Move *_dump_log routines to common/xfs
Quoted 5 lines · Catherine Hoang
Move
_scratch_remount_dump_logand_test_remount_dump_logfrom common/inject to common/xfs. These routines do not inject errors and should be placed with other xfs common functions.Signed-off-by Catherine Hoang <[email protected]>
Looks ok
Quoted 74 lines
--- common/inject | 26 -------------------------- common/xfs | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-)common/inject +0
-26@@ -111,29 +111,3 @@ _scratch_inject_error() _fail "Cannot inject error ${type} value ${value}." fi } - -# Unmount and remount the scratch device, dumping the log -_scratch_remount_dump_log() -{ - local opts="$1" - - if test -n "$opts"; then - opts="-o $opts" - fi - _scratch_unmount - _scratch_dump_log - _scratch_mount "$opts" -} - -# Unmount and remount the test device, dumping the log -_test_remount_dump_log() -{ - local opts="$1" - - if test -n "$opts"; then - opts="-o $opts" - fi - _test_unmount - _test_dump_log - _test_mount "$opts" -}common/xfs +26
-0@@ -1263,3 +1263,29 @@ _require_scratch_xfs_bigtime() _notrun "bigtime feature not advertised on mount?" _scratch_unmount } + +# Unmount and remount the scratch device, dumping the log +_scratch_remount_dump_log() +{ + local opts="$1" + + if test -n "$opts"; then + opts="-o $opts" + fi + _scratch_unmount + _scratch_dump_log + _scratch_mount "$opts" +} + +# Unmount and remount the test device, dumping the log +_test_remount_dump_log() +{ + local opts="$1" + + if test -n "$opts"; then + opts="-o $opts" + fi + _test_unmount + _test_dump_log + _test_mount "$opts" +}
Re: [PATCH 3/3] xfstests: Move *_dump_log routines to common/xfs
In reply to Catherine HoangQuoted 19 lines · Catherine Hoang
Move
_scratch_remount_dump_logand_test_remount_dump_logfrom common/inject to common/xfs. These routines do not inject errors and should be placed with other xfs common functions.Signed-off-by Catherine Hoang <[email protected]>--- common/inject | 26 -------------------------- common/xfs | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-)common/inject +0
-1@@ -111,29 +111,3 @@ _scratch_inject_error() _fail "Cannot inject error ${type} value ${value}." fi } -
common/inject _scratch_inject_error() · line 124
Quoted 10 lines
common/inject +0
-10-# Unmount and remount the scratch device, dumping the log -_scratch_remount_dump_log() -{ - local opts="$1" - - if test -n "$opts"; then - opts="-o $opts" - fi - _scratch_unmount - _scratch_dump_log
This function is a common function that could handle multiple filesystems, currently it supports xfs, ext4 and f2fs. So it's not a xfs-specific function, and moving it to common/xfs doesn't seem correct. Perhaps we should move it to common/log.
common/inject _scratch_inject_error() · line 137
Quoted 13 lines
common/inject +0
-13- _scratch_mount "$opts" -} - -# Unmount and remount the test device, dumping the log -_test_remount_dump_log() -{ - local opts="$1" - - if test -n "$opts"; then - opts="-o $opts" - fi - _test_unmount - _test_dump_log
Same here.
Thanks,
Eryu
Quoted 38 lines
common/inject +0
-2- _test_mount "$opts" -}common/xfs +26
-0@@ -1263,3 +1263,29 @@ _require_scratch_xfs_bigtime() _notrun "bigtime feature not advertised on mount?" _scratch_unmount } + +# Unmount and remount the scratch device, dumping the log +_scratch_remount_dump_log() +{ + local opts="$1" + + if test -n "$opts"; then + opts="-o $opts" + fi + _scratch_unmount + _scratch_dump_log + _scratch_mount "$opts" +} + +# Unmount and remount the test device, dumping the log +_test_remount_dump_log() +{ + local opts="$1" + + if test -n "$opts"; then + opts="-o $opts" + fi + _test_unmount + _test_dump_log + _test_mount "$opts" +}Signature · 1 line
2.25.1
Re: [PATCH 3/3] xfstests: Move *_dump_log routines to common/xfs
[add ext4 list to cc]
Quoted 25 lines · Eryu Guan
Quoted 24 lines · Catherine Hoang
Move
_scratch_remount_dump_logand_test_remount_dump_logfrom common/inject to common/xfs. These routines do not inject errors and should be placed with other xfs common functions.Signed-off-by Catherine Hoang <[email protected]>--- common/inject | 26 -------------------------- common/xfs | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-)common/inject +0
-6@@ -111,29 +111,3 @@ _scratch_inject_error() _fail "Cannot inject error ${type} value ${value}." fi } - -# Unmount and remount the scratch device, dumping the log -_scratch_remount_dump_log() -{ - local opts="$1" -
Quoted 8 lines
common/inject _scratch_inject_error() · line 124
Quoted 5 lines
common/inject +0
-5- if test -n "$opts"; then - opts="-o $opts" - fi - _scratch_unmount - _scratch_dump_logThis function is a common function that could handle multiple filesystems, currently it supports xfs, ext4 and f2fs. So it's not a
I don't think it even works correctly for ext*. *_dump_log() calls dumpe2fs -h, which displays the superblock contents, not the journal contents themselves, which is (I think) what this helper is supposed to do.
It really ought to do something along the lines of:
echo 'logdump -a' | debugfs $SCRATCH_DEV
Though fixing this is probably something the ext4 developers should look at...
Quoted 2 lines
xfs-specific function, and moving it to common/xfs doesn't seem correct. Perhaps we should move it to common/log.
Agreed. ;)
--D
Quoted 57 lines
common/inject _scratch_inject_error() · line 137
Quoted 13 lines
common/inject +0
-13- _scratch_mount "$opts" -} - -# Unmount and remount the test device, dumping the log -_test_remount_dump_log() -{ - local opts="$1" - - if test -n "$opts"; then - opts="-o $opts" - fi - _test_unmount - _test_dump_logSame here.
Thanks,
EryuQuoted 38 lines
common/inject +0
-2- _test_mount "$opts" -}common/xfs +26
-0@@ -1263,3 +1263,29 @@ _require_scratch_xfs_bigtime() _notrun "bigtime feature not advertised on mount?" _scratch_unmount } + +# Unmount and remount the scratch device, dumping the log +_scratch_remount_dump_log() +{ + local opts="$1" + + if test -n "$opts"; then + opts="-o $opts" + fi + _scratch_unmount + _scratch_dump_log + _scratch_mount "$opts" +} + +# Unmount and remount the test device, dumping the log +_test_remount_dump_log() +{ + local opts="$1" + + if test -n "$opts"; then + opts="-o $opts" + fi + _test_unmount + _test_dump_log + _test_mount "$opts" +}Signature · 1 line
2.25.1
Re: [External] : Re: [PATCH 3/3] xfstests: Move *_dump_log routines to common/xfs
In reply to Eryu GuanQuoted 30 lines · Eryu Guan
Quoted 26 lines · Catherine Hoang
Move
_scratch_remount_dump_logand_test_remount_dump_logfrom common/inject to common/xfs. These routines do not inject errors and should be placed with other xfs common functions.Signed-off-by Catherine Hoang <[email protected]>---
common/inject | 26 --------------------------
common/xfs | 26 ++++++++++++++++++++++++++2 files changed, 26 insertions(+), 26 deletions(-)common/inject +0
-8@@ -111,29 +111,3 @@ _scratch_inject_error() _fail "Cannot inject error ${type} value ${value}." fi } - -# Unmount and remount the scratch device, dumping the log -_scratch_remount_dump_log() -{ - local opts="$1" - - if test -n "$opts"; then - opts="-o $opts"
Quoted 8 lines
common/inject _scratch_inject_error() · line 124
Quoted 3 lines
common/inject +0
-3- fi - _scratch_unmount - _scratch_dump_logThis function is a common function that could handle multiple filesystems, currently it supports xfs, ext4 and f2fs. So it's not a xfs-specific function, and moving it to common/xfs doesn't seem correct. Perhaps we should move it to common/log.
I see, I will move this to common/log on the next revision.
Quoted 17 lines
Quoted 4 lines
common/inject +0
-3- _scratch_mount "$opts" -} -common/inject _scratch_inject_error() · line 137
Quoted 10 lines
common/inject +0
-10-# Unmount and remount the test device, dumping the log -_test_remount_dump_log() -{ - local opts="$1" - - if test -n "$opts"; then - opts="-o $opts" - fi - _test_unmount - _test_dump_logSame here.
Quoted 2 lines
Thanks,
Eryu
Sure, will move this too. Thanks for the feedback! Catherine
Quoted 39 lines
Quoted 39 lines
common/inject +0
-2- _test_mount "$opts" -}common/xfs +26
-0@@ -1263,3 +1263,29 @@ _require_scratch_xfs_bigtime() _notrun "bigtime feature not advertised on mount?" _scratch_unmount } + +# Unmount and remount the scratch device, dumping the log +_scratch_remount_dump_log() +{ + local opts="$1" + + if test -n "$opts"; then + opts="-o $opts" + fi + _scratch_unmount + _scratch_dump_log + _scratch_mount "$opts" +} + +# Unmount and remount the test device, dumping the log +_test_remount_dump_log() +{ + local opts="$1" + + if test -n "$opts"; then + opts="-o $opts" + fi + _test_unmount + _test_dump_log + _test_mount "$opts" +}Signature · 1 line
2.25.1