generic/508: fix to check inode creation time feature on scratch mountpoint
PATCH v3 1/1 generic/508: fix to check inode creation time feature on scratch mountpoint
_require_btime() just check inode creation time feature on TEST_DIR mountpoint, but generic/508 needs to do that check on SCRATCH_MNT mountpoint. Let's add _require_scratch_btime() for that, meanwhile handling scratch_{mkfs,mount,umount} inside the function to decouple with caller.
---
v3:
- hanlde scratch mkfs/mount/umount inside _require_scratch_btime
- relocate _require_scratch_btime
common/rc | 14 ++++++++++++++ tests/generic/508 | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-)
common/rc +14 -0
@@ -3851,6 +3851,20 @@ _require_btime() rm -f $TEST_DIR/test_creation_time } +_require_scratch_btime() +{ + _require_scratch + _scratch_mkfs > /dev/null 2>&1 + _scratch_mount + + $XFS_IO_PROG -f $SCRATCH_MNT/test_creation_time -c "statx -v" \ + | grep btime >>$seqres.full 2>&1 || \ + _notrun "inode creation time not supported by this filesystem" + rm -f $SCRATCH_MNT/test_creation_time + + _scratch_unmount +} + init_rc ################################################################################
tests/generic/508 +1 -1
@@ -46,10 +46,10 @@ _supported_os Linux _require_test_lsattr _require_statx _require_xfs_io_command "statx" "-v" -_require_btime _require_scratch _require_scratch_shutdown +_require_scratch_btime _scratch_mkfs >/dev/null 2>&1 _require_metadata_journaling $SCRATCH_DEV
Signature · 1 line
2.18.0.rc1
Quoted 23 lines · Chao Yu
_require_btime()just check inode creation time feature onTEST_DIRmountpoint, but generic/508 needs to do that check onSCRATCH_MNTmountpoint. Let's add_require_scratch_btime()for that, meanwhile handling scratch_{mkfs,mount,umount} inside the function to decouple with caller.Signed-off-by Chao Yu <[email protected]>---
v3:
- hanlde scratch mkfs/mount/umount inside_require_scratch_btime
- relocate_require_scratch_btimecommon/rc | 14 ++++++++++++++ tests/generic/508 | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-)common/rc +0
-0@@ -3851,6 +3851,20 @@ _require_btime() rm -f $TEST_DIR/test_creation_time }
common/rc _require_btime() · line 3863
Quoted 10 lines
common/rc +10
-0+_require_scratch_btime() +{ + _require_scratch + _scratch_mkfs > /dev/null 2>&1 + _scratch_mount + + $XFS_IO_PROG -f $SCRATCH_MNT/test_creation_time -c "statx -v" \ + | grep btime >>$seqres.full 2>&1 || \ + _notrun "inode creation time not supported by this filesystem" + rm -f $SCRATCH_MNT/test_creation_time
No need to remove that file - it's going to get mkfs'd again, anyway.
Otherwise looks fine. I'm not a fan of all these require_scratch rules having to run mkfs, but I can live with it.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 24 lines · Dave Chinner
Quoted 23 lines · Chao Yu
_require_btime()just check inode creation time feature onTEST_DIRmountpoint, but generic/508 needs to do that check onSCRATCH_MNTmountpoint. Let's add_require_scratch_btime()for that, meanwhile handling scratch_{mkfs,mount,umount} inside the function to decouple with caller.Signed-off-by Chao Yu <[email protected]>---
v3:
- hanlde scratch mkfs/mount/umount inside_require_scratch_btime
- relocate_require_scratch_btimecommon/rc | 14 ++++++++++++++ tests/generic/508 | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-)common/rc +0
-0@@ -3851,6 +3851,20 @@ _require_btime() rm -f $TEST_DIR/test_creation_time }
Quoted 13 lines
common/rc _require_btime() · line 3863
Quoted 10 lines
common/rc +10
-0+_require_scratch_btime() +{ + _require_scratch + _scratch_mkfs > /dev/null 2>&1 + _scratch_mount + + $XFS_IO_PROG -f $SCRATCH_MNT/test_creation_time -c "statx -v" \ + | grep btime >>$seqres.full 2>&1 || \ + _notrun "inode creation time not supported by this filesystem" + rm -f $SCRATCH_MNT/test_creation_timeNo need to remove that file - it's going to get mkfs'd again, anyway.
That's correct, I just saw Eryu has fixed this in upstream, so I think I don't need to send v4...
Quoted 5 lines
Otherwise looks fine. I'm not a fan of all these
require_scratchrules having to run mkfs, but I can live with it.Reviewed-by Dave Chinner <[email protected]>
Thanks for the review. :)
Thanks,