[PATCH rhel6-branch] Skip md containers with ignored volumes in unused BIOS raid members check (#1120640)

Artur Paszkiewicz artur.paszkiewicz at intel.com
Mon Sep 1 13:31:03 UTC 2014


Volumes which are not selected in Specialized Storage Devices are
ignored in addUdevDevice. This causes that their parent container won't
have its child counter incremented and its members are incorrectly
recognized as unused.

This patch adds checking for any volumes belonging to the container
before adding its members to the unusedRaidMembers list.

Resolves: rhbz#1120640
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz at intel.com>
---
 storage/devicetree.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 4045cdf..8eaeedc 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -2055,8 +2055,10 @@ class DeviceTree(object):
         # Check for unused BIOS raid members, unused dmraid members are added
         # to self.unusedRaidMembers as they are processed, extend this list
         # with unused mdraid BIOS raid members
+        devices = udev_get_block_devices()
         for c in self.getDevicesByType("mdcontainer"):
-            if c.kids == 0:
+            if c.kids == 0 and \
+               sum(d.get('MD_CONTAINER') == c.path for d in devices) == 0:
                 self.unusedRaidMembers.extend(map(lambda m: m.name, c.devices))
 
         self.intf.unusedRaidMembersWarning(self.unusedRaidMembers)
-- 
1.8.4.5



More information about the anaconda-patches mailing list