Skip to contentSkip to conversation

master - vgsplit: Make RAID 4/5/6 fail cleanly when too few PV specified

PATCH Jonathan Brassow 1 participant 1 message Apr 25, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3c4234f825c93c9cd61409ade9039ba4033c8008
Commit:        3c4234f825c93c9cd61409ade9039ba4033c8008
Parent:        4dffb9fca9dba16bba0ec41ecc16ed42fe2dd4cf
Author:        Jonathan Brassow <[email protected]>
AuthorDate:    Fri Apr 25 16:24:50 2014 -0500
Committer:     Jonathan Brassow <[email protected]>
CommitterDate: Fri Apr 25 16:24:50 2014 -0500

vgsplit: Make RAID 4/5/6 fail cleanly when too few PV specified

While the 'raid1/10' segment types were being handled inadvertently by '_move_mirrors()', the parity RAIDs were not being properly checked to ensure that the user had specified all necessary PVs when moving them. Thus, internal errors were being triggered when only part of a RAID LV was moved to the new VG. I've added a new function, '_move_raid()', which properly checks over any affected RAID LVs and ensures that all the necessary PVs are being moved.

---
 WHATS_NEW                       |    1 +
 test/shell/vgsplit-operation.sh |    6 ++--
 tools/vgsplit.c                 |   47 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 3 deletions(-)
WHATS_NEW +1 -0
index af9f6c3..3f879c9 100644
@@ -1,5 +1,6 @@
 Version 2.02.107 - 
 ==================================
+  Make vgsplit fail cleanly when not all PVs are specified for RAID 4/5/6.
   Make vgsplit work on mirrors with logs that share PVs with images.
   Use devices/ignore_suspended_devices=0 by default if not defined in lvm.conf.
   Use proper libmem mempool for allocation of unknown segment name.
test/shell/vgsplit-operation.sh +3 -3
index 5dbff69..3a8a51a 100644
@@ -238,9 +238,9 @@ COMM "vgsplit correctly splits RAID LV into $i VG ($j args)"
 
 		lvcreate -an -Zn -l 64 --type raid5 -i 2 -n $lv1 $vg1
 		if [ $j = PV ]; then
-#		  not vgsplit $vg1 $vg2 "$dev1"
-#		  not vgsplit $vg1 $vg2 "$dev2"
-#		  not vgsplit $vg1 $vg2 "$dev1" "$dev2"
+		  not vgsplit $vg1 $vg2 "$dev1"
+		  not vgsplit $vg1 $vg2 "$dev2"
+		  not vgsplit $vg1 $vg2 "$dev1" "$dev2"
 		  vgsplit $vg1 $vg2 "$dev1" "$dev2" "$dev3"
 		else
 		  vgsplit -n $lv1 $vg1 $vg2
tools/vgsplit.c +47 -0

71 lines not on this page · raw message