FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 05-18-2010, 04:49 PM
Hans de Goede
 
Default Handle vgs with duplicate names (#591469)

Hi All,

This patch-set fixes anaconda's handling of vgs with duplicate names, the
referenced bug nr is a rhel-6 bug, and I would like to include this patch
set into rhel6-branch for beta2. I admit this is a non trivial change, but
I'm reasonably confident that this won't cause any issues and I've run
several tests to confirm this works as advertised (and does not break
installs):

1) duplicate vg names, ignore, install into free space -> ok
2) duplicate vg names, filter out disks of one vg, clear linux -> ok
3) duplicate vg names, re-init, install into free space -> ok

Regards,

Hans

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 05-18-2010, 04:49 PM
Hans de Goede
 
Default Handle vgs with duplicate names (#591469)

With the changed udev rules properly setting the vg-uuid for pvs to the
pvs vg id, rather then getting the vg uuid by vg-name, and thus using
the same uuid for all pvs even if there are duplicate vgs, the uuid
check in LVMVolumeGroupDevice._addDevice triggers.

Rather then making this throw an error, track that there is a duplicate
vg and make complete always return false (even if there happens to be
the right number of pvs in the 2 vgs combined) and then let
devicetree._handleInconsistencies() further handle this.
---
storage/devices.py | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index ffd50c8..8894129 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -1759,6 +1759,7 @@ class LVMVolumeGroupDevice(DMDevice):
self.lv_uuids = []
self.lv_sizes = []
self.lv_attr = []
+ self.hasDuplicate = False

# circular references, here I come
self._lvs = []
@@ -1880,7 +1881,12 @@ class LVMVolumeGroupDevice(DMDevice):
raise ValueError("addDevice requires a PV arg")

if self.uuid and device.format.vgUuid != self.uuid:
- raise ValueError("UUID mismatch")
+ # this means there is another vg with the same name on the system
+ # set hasDuplicate which will make complete return False
+ # and let devicetree._handleInconsistencies() further handle this.
+ # Note we still add the device to our parents for use by
+ # devicetree._handleInconsistencies()
+ self.hasDuplicate = True

if device in self.pvs:
raise ValueError("device is already a member of this VG")
@@ -1889,7 +1895,7 @@ class LVMVolumeGroupDevice(DMDevice):
device.addChild()

# now see if the VG can be activated
- if len(self.parents) == self.pvCount:
+ if self.complete:
self.setup()

def _removeDevice(self, device):
@@ -2124,6 +2130,10 @@ class LVMVolumeGroupDevice(DMDevice):
"""Check if the vg has all its pvs in the system
Return True if complete.
"""
+ # vgs with duplicate names are overcomplete, which is not what we want
+ if self.hasDuplicate:
+ return False
+
return len(self.pvs) == self.pvCount or not self.exists


--
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 06:00 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org