[PATCH 3/3] Don't activate / de-activate dmraid sets on setup / teardown

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

 



Since BIOS RAID sets never change there is no need to deactivate them and
later activate them again. This also fixes problems in case the followng
happens:
1) raid sets get activated, pyblock creates device-mappings for partitions on
   the set.
2) The partition table changes while exectuing actions
3) the raid sets gets de-activated, because of devicetree.processActions()
   tearing down everything in response to a disklabel commit error caused
   by lvm or mdraid using a partiton
4) pyblock tries to remove the partition mappings as it has created them,
   but the partition table has changed, and when parted commits partition
   table changes of a dmraid set to disk, it also modifies the partitions
   device-mappings. pyblock tries to remove a non existing mapping ->
   backtrace.
---
 storage/devices.py |   23 ++++-------------------
 1 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index bc8951f..7b4b314 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2682,34 +2682,19 @@ class DMRaidArrayDevice(DiskDevice):
         else:
             self.sysfsPath = ''
 
-    def teardown(self, recursive=None):
-        """ Close, or tear down, a device. """
+    def deactivate(self):
+        """ Deactivate the raid set. """
         log_method_call(self, self.name, status=self.status)
-        if not self.exists:
-            raise DeviceError("device has not been created", self.name)
-
-        if self.format.exists:
-            self.format.teardown()
-            udev_settle(timeout=10)
-
         # This call already checks if the set is not active.
         self._raidSet.deactivate()
 
-    def setup(self, intf=None):
-        """ Open, or set up, a device. """
+    def activate(self):
+        """ Activate the raid set. """
         log_method_call(self, self.name, status=self.status)
-        if not self.exists:
-            raise DeviceError("device has not been created", self.name)
-
         # This call already checks if the set is active.
         self._raidSet.activate(mknod=True)
-
         udev_settle()
 
-        # we always probe since the device may not be set up when we want
-        # information about it
-        self._size = self.currentSize
-
     @property
     def mediaPresent(self):
         # Even if teared down we still want to show up in storage.disks
-- 
1.6.5.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