[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH 6/6] Try harder to stop mdraid arrays
- From: Hans de Goede <hdegoede redhat com>
- To: Discussion of Development and Customization of the Red Hat Linux Installer <anaconda-devel-list redhat com>
- Cc:
- Subject: [PATCH 6/6] Try harder to stop mdraid arrays
- Date: Tue, 15 Sep 2009 13:30:15 +0200
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
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]