generic/459: Fix check for ro-remount in extN
[xfstests-dev.git] / tests / generic / 459
index eb05fb80e59603cc3817fb11e7cb0d6927879bdb..e755cf7f1d515cb3f3349c36d2726f513ded8c32 100755 (executable)
@@ -125,16 +125,19 @@ $LVM_PROG lvextend -L $newpsize $vgname/$poolname >>$seqres.full 2>&1
 wait $freezeid
 ret=$?
 
-
 # Different filesystems will handle the lack of real space in different ways,
 # some will remount the filesystem in read-only mode, some will not. These tests
 # will check if:
 #      - The filesystem turns into Read-Only and reject further writes
 #      - The filesystem stays in Read-Write mode, but can be frozen/thawed
 #        without getting stuck.
-ISRO=$(_fs_options /dev/mapper/$vgname-$snapname | grep -w "ro")
-
 if [ $ret -ne 0 ]; then
+       # fsfreeze failed, filesystem should reject further writes and remount
+       # as readonly. Sometimes the previous write process won't trigger
+       # ro-remount, e.g. on ext3/4, do additional touch here to make sure
+       # filesystems see the metadata I/O error.
+       touch $SCRATCH_MNT/newfile >/dev/null 2>&1
+       ISRO=$(_fs_options /dev/mapper/$vgname-$snapname | grep -w "ro")
        if [ -n "$ISRO" ]; then
                echo "Test OK"
        else