Skip to contentSkip to conversation

ext4/044: Fix failure when mount options are incompatible with ext3

PATCH In review Jan Kara 2 participants 3 messages Dec 5, 2022 – Dec 6, 2022

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 ext4/044: Fix failure when mount options are incompatible with ext3

There are some mount options that are incompatible with ext3 filesystem type. If they are used, this test fails because it tries to remount the filesystem as ext3. The test makes sense even without remounting as ext3 so just make the test silently skip the remount.

---
 tests/ext4/044 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
tests/ext4/044 +4 -3
index 50de5a40bdc7..96fa70cc0d1e 100755
@@ -53,9 +53,10 @@ _within_tolerance "sec_ctime" $sec_ctime $sec 1 -v
 
 _scratch_unmount >> $seqres.full 2>&1
 
-# Test mount to ext3 then mount back to ext4 and check timestamp again
-_mount -t ext3 `_scratch_mount_options $*` || _fail "ext3 mount failed"
-_scratch_unmount >> $seqres.full 2>&1
+# Test mount to ext3 then mount back to ext4 and check timestamp again.  We
+# ignore if ext3 failed to mount. It can happen because some mount options are
+# incompatible with ext3. Still the test makes sense.
+_mount -t ext3 `_scratch_mount_options $*` >> $seqres.full 2>&1 && _scratch_unmount >> $seqres.full 2>&1
 _scratch_mount
 
 nsec_atime2=`$here/src/t_get_file_time $SCRATCH_MNT/tmp_file atime nsec`
Signature · 1 line
2.35.3
Reviewed-by on v1 1/1
#1 lore raw

Hi Jan,

Quoted 16 lines · Jan Kara

There are some mount options that are incompatible with ext3 filesystem type. If they are used, this test fails because it tries to remount the filesystem as ext3. The test makes sense even without remounting as ext3 so just make the test silently skip the remount.

---
 tests/ext4/044 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
tests/ext4/044 +0 -0
index 50de5a40bdc7..96fa70cc0d1e 100755
@@ -53,9 +53,10 @@ _within_tolerance "sec_ctime" $sec_ctime $sec 1 -v
 

tests/ext4/044 _within_tolerance "sec_ctime" $sec_ctime $sec 1 -v · line 60

Quoted 10 lines
tests/ext4/044 +4 -3
 _scratch_unmount >> $seqres.full 2>&1
 
-# Test mount to ext3 then mount back to ext4 and check timestamp again
-_mount -t ext3 `_scratch_mount_options $*` || _fail "ext3 mount failed"
-_scratch_unmount >> $seqres.full 2>&1
+# Test mount to ext3 then mount back to ext4 and check timestamp again.  We
+# ignore if ext3 failed to mount. It can happen because some mount options are
+# incompatible with ext3. Still the test makes sense.
+_mount -t ext3 `_scratch_mount_options $*` >> $seqres.full 2>&1 && _scratch_unmount >> $seqres.full 2>&1
 _scratch_mount

I suppose this makes sense compared to filtering or dropping all mount options. $* should always be empty here, right?

Looks fine otherwise...

author
#2 lore raw

Hi David!

Quoted 19 lines · David Disseldorp
Quoted 18 lines · Jan Kara

There are some mount options that are incompatible with ext3 filesystem type. If they are used, this test fails because it tries to remount the filesystem as ext3. The test makes sense even without remounting as ext3 so just make the test silently skip the remount.

---
 tests/ext4/044 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
tests/ext4/044 +0 -0
index 50de5a40bdc7..96fa70cc0d1e 100755
@@ -53,9 +53,10 @@ _within_tolerance "sec_ctime" $sec_ctime $sec 1 -v
 
 _scratch_unmount >> $seqres.full 2>&1
 
Quoted 11 lines

tests/ext4/044 _within_tolerance "sec_ctime" $sec_ctime $sec 1 -v · line 60

Quoted 8 lines
tests/ext4/044 +4 -3
-# Test mount to ext3 then mount back to ext4 and check timestamp again
-_mount -t ext3 `_scratch_mount_options $*` || _fail "ext3 mount failed"
-_scratch_unmount >> $seqres.full 2>&1
+# Test mount to ext3 then mount back to ext4 and check timestamp again.  We
+# ignore if ext3 failed to mount. It can happen because some mount options are
+# incompatible with ext3. Still the test makes sense.
+_mount -t ext3 `_scratch_mount_options $*` >> $seqres.full 2>&1 && _scratch_unmount >> $seqres.full 2>&1
 _scratch_mount

I suppose this makes sense compared to filtering or dropping all mount options.

Yeah, filtering would need constant updating and dropping all mount options could have some unexpected sideeffects.

Quoted 1 line

$* should always be empty here, right?

Yeah, likely yes. I've just copied that without thinking too much about it :).

Quoted 2 lines

Looks fine otherwise...

Thanks for review!

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR