Whamcloud - gitweb
e2scrub, e2scrub_all: don't sleep unnecessarily in exitcode
[tools/e2fsprogs.git] / scrub / e2scrub.in
index b778a92..30ab7cb 100644 (file)
@@ -66,7 +66,7 @@ exitcode() {
        # for capturing all the log messages if the scrub fails, because the
        # fail service uses the service name to gather log messages for the
        # error report.
-       if [ -n "${SERVICE_MODE}" ]; then
+       if [ -n "${SERVICE_MODE}" -a "${ret}" -ne 0 ]; then
                test "${ret}" -ne 0 && ret=1
                sleep 2
        fi
@@ -201,7 +201,7 @@ mark_corrupt() {
 
 setup() {
        # Try to remove snapshot for 30s, bail out if we can't remove it.
-       lveremove_deadline="$(( $(date "+%s") + 30))"
+       lvremove_deadline="$(( $(date "+%s") + 30))"
        ${DBG} lvremove -f "${LVM2_VG_NAME}/${snap}" 2>/dev/null
        while [ -e "${snap_dev}" ] && [ "$?" -eq "5" ] &&
              [ "$(date "+%s")" -lt "${lvremove_deadline}" ]; do