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

[rhel6-branch 1/2] mpath: teardown format from MultipathDevice.teardown()



Sometimes there's no partition table on the multipath disk, just
filesystem. If we don't call teardown on the device format, such
filesystems will stay mounted.
---
 storage/devices.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 321a746..7ef1160 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -3205,6 +3205,14 @@ class MultipathDevice(DMDevice):
         if not self.exists and not recursive:
             raise DeviceError("device has not been created", self.name)
 
+        if self.status:
+            # in case format is not a disklabel but a filesystem
+            if self.originalFormat.exists:
+                self.originalFormat.teardown()
+            if self.format.exists:
+                self.format.teardown()
+            udev_settle()
+
         if self.exists and os.path.exists(self.path):
             #self.teardownPartitions()
             #rc = iutil.execWithRedirect("multipath",
-- 
1.7.1.1


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