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

[PATCH] Deactivate md arrays regardless of state if the device is present. (#496441)



Instead of only deactivating an array whose state is some variation on
"active", try to deactivate any array that appears to be assembled.
---
 storage/devices.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 44dc878..5a04b79 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2494,7 +2494,10 @@ class MDRaidArrayDevice(StorageDevice):
             self.format.teardown()
             udev_settle(timeout=10)
 
-        if self.status:
+        # We don't really care what the array's state is. If the device
+        # file exists, we want to deactivate it. mdraid has too many
+        # states.
+        if os.path.exists(self.path):
             mdraid.mddeactivate(self.path)
 
         if recursive:
-- 
1.6.0.6


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