Blame 0010-mdraid-md-shutdown.sh-wait-until-md-devices-are-clea.patch

Harald Hoyer 18c19d
From 57038a41fac7db2ae90a6cbc10cf9b737768a115 Mon Sep 17 00:00:00 2001
Harald Hoyer 18c19d
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 18c19d
Date: Fri, 8 Jun 2012 10:28:31 +0200
Harald Hoyer 18c19d
Subject: [PATCH] mdraid/md-shutdown.sh: wait until md devices are clean
Harald Hoyer 18c19d
Harald Hoyer 18c19d
---
Harald Hoyer 18c19d
 modules.d/90mdraid/md-shutdown.sh |   11 +++++++----
Harald Hoyer 18c19d
 1 file changed, 7 insertions(+), 4 deletions(-)
Harald Hoyer 18c19d
Harald Hoyer 18c19d
diff --git a/modules.d/90mdraid/md-shutdown.sh b/modules.d/90mdraid/md-shutdown.sh
Harald Hoyer 18c19d
index 0d41008..1e6c9f6 100755
Harald Hoyer 18c19d
--- a/modules.d/90mdraid/md-shutdown.sh
Harald Hoyer 18c19d
+++ b/modules.d/90mdraid/md-shutdown.sh
Harald Hoyer 18c19d
@@ -5,12 +5,15 @@ _do_md_shutdown() {
Harald Hoyer 18c19d
     local ret
Harald Hoyer 18c19d
     local final=$1
Harald Hoyer 18c19d
     local _offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot)
Harald Hoyer 18c19d
-    info "Disassembling mdraid devices."
Harald Hoyer 18c19d
-    mdadm $_offroot -v --stop --scan
Harald Hoyer 18c19d
+    info "Waiting for mdraid devices to be clean."
Harald Hoyer 18c19d
+    mdadm $_offroot -vv --wait-clean --scan| vinfo
Harald Hoyer 18c19d
     ret=$?
Harald Hoyer 18c19d
+    info "Disassembling mdraid devices."
Harald Hoyer 18c19d
+    mdadm $_offroot -vv --stop --scan | vinfo
Harald Hoyer 18c19d
+    ret=$(($ret+$?))
Harald Hoyer 18c19d
     if [ "x$final" != "x" ]; then
Harald Hoyer 18c19d
-        info "cat /proc/mdstat"
Harald Hoyer 18c19d
-        cat /proc/mdstat | vinfo
Harald Hoyer 18c19d
+        info "/proc/mdstat:"
Harald Hoyer 18c19d
+        vinfo < /proc/mdstat
Harald Hoyer 18c19d
     fi
Harald Hoyer 18c19d
     return $ret
Harald Hoyer 18c19d
 }