mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-30 01:47:56 +03:00
Peter Rajnoha
7e5e2dd4ee
vgextend: do not allow PV with 0 MDAs to be added while already in a VG
If extending a VG and including a PV with 0 MDAs that was already a part of a VG, the vgextend allowed that PV to be added and we ended up *with one PV in two VGs*! The vgextend code used the 'pv_by_path' fn that returned a PV for a given path. However, when the PV did not have any metadata areas, the fn just returned a PV without any reference to existing VG. Consequently, any checks for the existing VG failed. [0] raw/~ # pvcreate --metadatacopies 0 /dev/sda Physical volume "/dev/sda" successfully created [0] raw/~ # pvcreate --metadatacopies 1 /dev/sdb Physical volume "/dev/sdb" successfully created [0] raw/~ # vgcreate vg1 /dev/sda /dev/sdb Volume group "vg1" successfully created [0] raw/~ # pvcreate --metadatacopies 1 /dev/sdc Physical volume "/dev/sdc" successfully created [0] raw/~ # vgcreate vg2 /dev/sdc Volume group "vg2" successfully created Before this patch (incorrect): [0] raw/~ # vgextend vg2 /dev/sda Volume group "vg2" successfully extended With this patch (correct): [0] raw/~ # vgextend vg2 /dev/sda Physical volume '/dev/sda' is already in volume group 'vg1' Unable to add physical volume '/dev/sda' to volume group 'vg2'.
This tree contains the LVM2 and device-mapper tools and libraries. For more information about LVM2 read the changelog in the WHATS_NEW file. Installation instructions are in INSTALL. There is no warranty - see COPYING and COPYING.LIB. Tarballs are available from: ftp://sources.redhat.com/pub/lvm2/ The source code is stored in git: http://git.fedorahosted.org/git/lvm2.git git clone git://git.fedorahosted.org/git/lvm2.git Mailing list for general discussion related to LVM2: linux-lvm@redhat.com Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm Mailing lists for LVM2 development, patches and commits: lvm-devel@redhat.com Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm lvm2-commits@lists.fedorahosted.org (Read-only archive of commits) Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits Mailing list for device-mapper development, including kernel patches and multipath-tools: dm-devel@redhat.com Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel The source code repository used until 7th June 2012 is accessible here: http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/?cvsroot=lvm2.
Description
Languages
C
75.5%
Shell
18.7%
Python
2.9%
M4
1%
Makefile
0.8%
Other
1%