[PATCH 1/9] Fix udev_device_is_md.

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

 



MD_FOO values are not consistent enough to be used to differentiate
md devices from md member devices, so just check for
the /sys/class/block/<name>/md/ subdirectory as only md devices have
one.

Related: rhbz#678689
Related: rhbz#681608
---
 pyanaconda/storage/devicetree.py |    2 +-
 pyanaconda/storage/udev.py       |    9 +++------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index c4b31c2..39a4245 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -955,7 +955,7 @@ class DeviceTree(object):
         elif udev_device_is_dm(info):
             log.debug("%s is a device-mapper device" % name)
             device = self.addUdevDMDevice(info)
-        elif udev_device_is_md(info):
+        elif udev_device_is_md(info) and not udev_device_get_md_container(info):
             log.debug("%s is an md device" % name)
             if uuid:
                 # try to find the device by uuid
diff --git a/pyanaconda/storage/udev.py b/pyanaconda/storage/udev.py
index df6d99e..96faf48 100644
--- a/pyanaconda/storage/udev.py
+++ b/pyanaconda/storage/udev.py
@@ -166,13 +166,10 @@ def udev_device_is_md(info):
     if udev_device_is_partition(info):
         return False
 
-    # imsm member disks have MD_METADATA set, but are not arrays
+    # The udev information keeps shifting around. Only md arrays have a
+    # /sys/class/block/<name>/md/ subdirectory.
     md_dir = "/sys" + udev_device_get_sysfs_path(info) + "/md"
-
-    # isw raid set *members* have MD_METADATA set, but are not arrays!
-    return (info.has_key("MD_METADATA") and
-            info.get("ID_FS_TYPE") != "isw_raid_member" and
-            os.path.exists(md_dir))
+    return os.path.exists(md_dir)
 
 def udev_device_is_cciss(info):
     """ Return True if the device is a CCISS device. """
-- 
1.7.3.5

_______________________________________________
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