[blivet][rhel7][PATCH] Revert "Try to deactivate lvm on corrupted gpt disks."

David Lehman dlehman at redhat.com
Tue Jan 27 17:03:08 UTC 2015


This reverts commit cae43dcec84d079b00deeba7a9200ef186c26908.

In some scenarios (multiple md pvs?) we can fail to detect the vg
the first time but succeed shortly thereafter. Also, this patch was
incomplete in that the devicetree will still try to handle the udev
entries for the now-deactivated lvs, which causes a traceback.

Resolves: rhbz#1186317
---
 blivet/devicetree.py | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index afc8d79..97dd6d4 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -27,7 +27,7 @@ import shutil
 import pprint
 import copy
 
-from .errors import CryptoError, DeviceError, DeviceTreeError, DiskLabelCommitError, DMError, FSError, InvalidDiskLabelError, LUKSError, LVMError, MDRaidError, StorageError
+from .errors import CryptoError, DeviceError, DeviceTreeError, DiskLabelCommitError, DMError, FSError, InvalidDiskLabelError, LUKSError, MDRaidError, StorageError
 from .devices import BTRFSDevice, BTRFSSubVolumeDevice, BTRFSVolumeDevice, BTRFSSnapShotDevice
 from .devices import DASDDevice, DMDevice, DMLinearDevice, DMRaidArrayDevice, DiskDevice
 from .devices import FcoeDiskDevice, FileDevice, LoopDevice, LUKSDevice
@@ -695,13 +695,7 @@ class DeviceTree(object):
         vg_name = udev.device_get_lv_vg_name(info)
         device = self.getDeviceByName(vg_name)
         if not device:
-            # this means something is messed up, like a corrupt gpt disklabel
-            # that the kernel is perfectly happy with but parted refuses to use
             log.error("failed to find vg '%s' after scanning pvs", vg_name)
-            try:
-                lvm.vgdeactivate(vg_name)
-            except LVMError as e:
-                log.error("failed to deactivate vg: %s", e)
 
         # Don't return the device like we do in the other addUdevFooDevice
         # methods. The device we have here is a vg, not an lv.
-- 
1.9.3



More information about the anaconda-patches mailing list