fs/ext4: check if the big block device is mounted at do_setup()
PATCH v3 1/4 fs/ext4: check if the big block device is mounted at do_setup()
The test requires the big block device is umounted before test, so check at do_setup(), TBROK if it's mounted
--- testcases/kernel/fs/ext4-new-features/ext4_funcs.sh | 3 +++ 1 file changed, 3 insertions(+)
testcases/kernel/fs/ext4-new-features/ext4_funcs.sh +3 -0
@@ -45,6 +45,9 @@ ext4_setup() tst_brkm TCONF "tests need a big block device(5G-10G)" else export EXT4_DEV=$LTP_BIG_DEV + if mount | cut -d' ' -f1 | grep -q ^$EXT4_DEV$ ; then + tst_brkm TBROK "$EXT4_DEV should be umounted before test" + fi fi tst_tmpdir
Signature · 1 line
2.14.1
PATCH v3 2/4 fs/ext4: Replace umount with tst_umount
Replace umount with tst_umount in common lib to handle umount failed due to device busy
--- .../ext4_nsec_timestamps_test.sh | 25 +++++++--------------- 1 file changed, 8 insertions(+), 17 deletions(-)
testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh +8 -17
@@ -56,15 +56,10 @@ ext4_test_sec_timestamps() if [ $atime -ne 0 -o $mtime -ne 0 -o $ctime -ne 0 ]; then tst_resm TFAIL "Timestamp is not second(atime: $atime, mtime: \ $mtime, ctime: $ctime)" - umount mnt_point - return - fi - - umount mnt_point - if [ $? -ne 0 ]; then - tst_resm TFAIL "failed to umount ext4 filesystem" + tst_umount mnt_point return fi + tst_umount mnt_point tst_resm TPASS "Ext4 nanosecond timestamps test with 128 inode size pass" }
@@ -108,7 +103,7 @@ ext4_test_nsec_timestamps() if [ $nsec_atime -eq 0 -a $nsec_mtime -eq 0 -a $nsec_ctime -eq 0 ] then tst_resm TFAIL "The timestamp is not nanosecond(nsec_atime: $nsec_atime, nsec_mtime: $nsec_mtime, nsec_ctime: $nsec_ctime)" - umount mnt_point + tst_mount mnt_point return fi
@@ -122,15 +117,11 @@ ext4_test_nsec_timestamps() than the current time we got.(sec_atime: $sec_atime, \ sec_mtime: $sec_mtime, sec_ctime: $sec_ctime, \ cur_time[s]: $sec)" - umount mnt_point + tst_umount mnt_point return fi - umount mnt_point - if [ $? -ne 0 ]; then - tst_resm TFAIL "failed to umount ext4 filesystem" - return - fi + tst_umount mnt_point # Test mount to ext3 and then mount back to ext4 mount -t ext3 $EXT4_DEV mnt_point
@@ -138,7 +129,7 @@ ext4_test_nsec_timestamps() tst_resm TFAIL "failed to mount to ext3" return fi - umount mnt_point + tst_umount mnt_point mount -t ext4 $EXT4_DEV mnt_point if [ $? -ne 0 ]; then
@@ -156,11 +147,11 @@ ext4_test_nsec_timestamps() unexpected. Before[atime mtime ctime]: $nsec_atime \ $nsec_mtime $nsec_ctime, After[atime mtime ctime]: \ $nsec_atime2 $nsec_mtime2 $nsec_ctime2)" - umount mnt_point + tst_umount mnt_point return fi - umount mnt_point + tst_umount mnt_point tst_resm TPASS "Ext4 nanosecond timestamps test with 256 inode size pass" }
Signature · 1 line
2.14.1
PATCH v3 3/4 fs/ext4: bug fix - incorect argument ctime vs mtime
In reply to Yixin Zhangnsec_ctime2 should call ext4_file_time with argument ctime, not mtime.
--- .../ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh +1 -1
@@ -139,7 +139,7 @@ ext4_test_nsec_timestamps() nsec_atime2=`ext4_file_time mnt_point/tmp_file atime nsec` nsec_mtime2=`ext4_file_time mnt_point/tmp_file mtime nsec` - nsec_ctime2=`ext4_file_time mnt_point/tmp_file mtime nsec` + nsec_ctime2=`ext4_file_time mnt_point/tmp_file ctime nsec` if [ $nsec_atime -ne $nsec_atime2 -o $nsec_ctime -ne $nsec_ctime2 -o \ $nsec_mtime -ne $nsec_mtime2 ]; then
Signature · 1 line
2.14.1
PATCH v3 4/4 fs/ext4: update format and fix typo
In reply to Yixin Zhang--- .../ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh +3 -4
@@ -71,7 +71,7 @@ ext4_test_nsec_timestamps() mkfs.ext3 -I 256 $EXT4_DEV >/dev/null 2>&1 if [ $? -ne 0 ]; then - tst_resm TFAIL "failed to create ext4 filesystem" + tst_resm TFAIL "failed to create ext3 filesystem" return fi
@@ -100,8 +100,7 @@ ext4_test_nsec_timestamps() nsec_ctime=`ext4_file_time mnt_point/tmp_file ctime nsec` # Test nanosecond - if [ $nsec_atime -eq 0 -a $nsec_mtime -eq 0 -a $nsec_ctime -eq 0 ] - then + if [ $nsec_atime -eq 0 -a $nsec_mtime -eq 0 -a $nsec_ctime -eq 0 ]; then tst_resm TFAIL "The timestamp is not nanosecond(nsec_atime: $nsec_atime, nsec_mtime: $nsec_mtime, nsec_ctime: $nsec_ctime)" tst_mount mnt_point return
@@ -142,7 +141,7 @@ ext4_test_nsec_timestamps() nsec_ctime2=`ext4_file_time mnt_point/tmp_file ctime nsec` if [ $nsec_atime -ne $nsec_atime2 -o $nsec_ctime -ne $nsec_ctime2 -o \ - $nsec_mtime -ne $nsec_mtime2 ]; then + $nsec_mtime -ne $nsec_mtime2 ]; then tst_resm TFAIL "File nanosecond timestamp has changed \ unexpected. Before[atime mtime ctime]: $nsec_atime \ $nsec_mtime $nsec_ctime, After[atime mtime ctime]: \
Signature · 1 line
2.14.1
PATCH v3 4/4 fs/ext4: update format and fix typo
Hi!
testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh ext4_test_nsec_timestamps() · line 144
Quoted 3 lines
testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh +1
-1if [ $nsec_atime -ne $nsec_atime2 -o $nsec_ctime -ne $nsec_ctime2 -o \ - $nsec_mtime -ne $nsec_mtime2 ]; then + $nsec_mtime -ne $nsec_mtime2 ]; then
I've remove this change from the patch, since it looks like a mistake and pushed the whole patchset, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]