[PATCH] xfstests: exit non-0 if fs check fails

Eric Sandeen sandeen at redhat.com
Wed Mar 31 18:38:23 CDT 2010


Right now if any of the _check_scratch_fs tests etc fail,
the check script exits but with 0 status.

This change will cause the status to be non-0 so we can detect
the error.

Signed-off-by: Eric Sandeen <sandeen at redhat.com>
---

(aside - we could make it 2 instead of 1, so that a calling script
could fsck and continue ... thoughts?)

diff --git a/common.rc b/common.rc
index 2103a77..301ae6a 100644
--- a/common.rc
+++ b/common.rc
@@ -959,6 +959,7 @@ _check_generic_filesystem()
         echo "*** mount output ***"                             >>$here/$seq.full
         _mount                                                  >>$here/$seq.full
         echo "*** end mount output"                             >>$here/$seq.full
+        status=1
     elif [ "$type" = "$FSTYP" ]
     then
 	# was mounted ...
@@ -1054,6 +1055,7 @@ _check_xfs_filesystem()
         echo "*** mount output ***"                             >>$here/$seq.full
         _mount                                                  >>$here/$seq.full
         echo "*** end mount output"                             >>$here/$seq.full
+        status=1
     elif [ "$type" = "xfs" ]
     then
 	_mount_or_remount_rw "$extra_mount_options" $device $mountpoint




More information about the xfs mailing list