diff mbox

[v2,2/3] common: return failure if _check_xxx_filesystem find corruption

Message ID 1418730102-17061-2-git-send-email-eguan@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eryu Guan Dec. 16, 2014, 11:41 a.m. UTC
So the callers could know if these functions find corruptions by the
return value.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---

v2:
- write new commit message, the old one is not correct
- split out the 'check' check as a separate patch

 common/rc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/common/rc b/common/rc
index 6bbdc69..bf4e580 100644
--- a/common/rc
+++ b/common/rc
@@ -1722,6 +1722,7 @@  _check_generic_filesystem()
 	if [ "$iam" != "check" ]; then
 		exit 1
 	fi
+	return 1
     fi
 
     return 0
@@ -1823,6 +1824,7 @@  _check_xfs_filesystem()
 	if [ "$iam" != "check" ]; then
 		exit 1
 	fi
+	return 1
     fi
 
     return 0
@@ -1867,7 +1869,8 @@  _check_udf_filesystem()
     $here/src/udf_test $OPT_ARG $device | tee $seqres.checkfs | egrep "Error|Warning" | \
 	_udf_test_known_error_filter | \
 	egrep -iv "Error count:.*[0-9]+.*total occurrences:.*[0-9]+|Warning count:.*[0-9]+.*total occurrences:.*[0-9]+" && \
-        echo "Warning UDF Verifier reported errors see $seqres.checkfs."
+        echo "Warning UDF Verifier reported errors see $seqres.checkfs." && return 1
+    return 0
 }
 
 _check_xfs_test_fs()
@@ -1935,6 +1938,7 @@  _check_btrfs_filesystem()
 	if [ "$iam" != "check" ]; then
 		exit 1
 	fi
+	return 1
     fi
 
     return 0