[PATCH 6/6] Try harder to stop mdraid arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sometimes mdadm --stop reports failure, but the array stops
after a while never the less, this happens with container
members, see bug rh523334 (this works around the first scenario
mentioned in the bug, the second scenario will still cause anaconda
to fail).
---
 storage/devices.py |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index b4b7aa5..7d68ffd 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -96,6 +96,7 @@
 import os
 import math
 import copy
+import time
 
 # device backend modules
 from devicelibs import mdraid
@@ -2468,7 +2469,18 @@ class MDRaidArrayDevice(StorageDevice):
         # file exists, we want to deactivate it. mdraid has too many
         # states.
         if self.exists and os.path.exists(self.path):
-            mdraid.mddeactivate(self.path)
+            try:
+                mdraid.mddeactivate(self.path)
+            except MDRaidError:
+                # Sometimes mdadm --stop reports failure, but the array stops
+                # after a while never the less, this happens with container
+                # members, see bug rh523334
+                if self.devices[0].type == "mdcontainer":
+                    time.sleep(1)
+                    if self.status:
+                        raise
+                else:
+                    raise
 
         if recursive:
             self.teardownParents(recursive=recursive)
-- 
1.6.4.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux