[PATCH 4/6] Don't scan stopped md devices

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

 



mdraid is really braindead, when a device is stopped
it is no longer usefull in anyway (and we should not
probe it) yet it still sticks around, see bug rh523387
---
 storage/udev.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/storage/udev.py b/storage/udev.py
index f6347d5..f07b3ca 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -60,6 +60,16 @@ def udev_get_block_devices():
     for path in udev_enumerate_block_devices():
         entry = udev_get_block_device(path)
         if entry:
+            if entry["name"].startswith("md"):
+                # mdraid is really braindead, when a device is stopped
+                # it is no longer usefull in anyway (and we should not
+                # probe it) yet it still sticks around, see bug rh523387
+                state = None
+                state_file = "/sys/%s/md/array_state" % entry["sysfs_path"]
+                if os.access(state_file, os.R_OK):
+                    state = open(state_file).read().strip()
+                if state == "clear":
+                    continue
             entries.append(entry)
     return entries
 
-- 
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