[PATCH 1/1] Make sure Udev does not screw us up.

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

 



I have seen instances where Udev says there is an lvm format in device
and also asserts that there is dmraid format in device# (the partition).
This tries to verify that all the parents of the mdarray that are
partitions are contained in a disk that has format = None.
---
 storage/devicetree.py |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 7540ff2..ed50ad8 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1558,6 +1558,25 @@ class DeviceTree(object):
                     lvm.lvm_cc_addFilterRejectRegexp(parent.name)
             return
 
+        elif device.type == "mdarray":
+            # Make sure Udev does not screw us up.  I have seen instances where
+            # Udev says there is an lvm format in device and also asserts that
+            # there is dmraid format in device# (the partition).  This tries to
+            # verify that all the parents of the mdarray that are partitions
+            # are contained in a disk that has format = None.
+            # FIXME: We should clean the metadata on disk somehow.
+            # FIXME: should we ask the user?
+            for parent in device.parents:
+                if parent.type == "partition" and \
+                    parent.parents[0].format.type is not None:
+                        format = formats.getFormat(None)
+                        log.error("Automatically corrected fomrat error on %s. "
+                                "Changed from %s to %s." %
+                                (device.name,parent.parents[0].format, format))
+                        parent.parents[0].format = format
+
+
+
     def populate(self):
         """ Locate all storage devices. """
         # each iteration scans any devices that have appeared since the
-- 
1.6.0.6

_______________________________________________
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