Skip to contentSkip to conversation

ts-xen-build-prep: don't attempt to extend volume group by 0.

PATCH In review Ian Campbell 2 participants 2 messages Sep 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ts-xen-build-prep: don't attempt to extend volume group by 0.

overall_limit_pe can set its argument to 0 if the VG is already as large as it is allowed to be.

In which case we would end up passing "-l +0" to lvextend, which it complains about and then fails.

Move the clamping of $vg_more_free_pe to outside the check for it being 0.

Based on a patch by Robert Ho.

---
 ts-xen-build-prep | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ts-xen-build-prep +1 -1
index 03ad35c..b35e91b 100755
@@ -151,9 +151,9 @@ sub lvextend1 ($$$) {
 
     $do_limit_pe->(\$vg_more_free_pe, 'unstriped');
 
+    overall_limit_pe(\$vg_more_free_pe);
     if ($vg_more_free_pe) {
         logm("$what: unstriped $vg_more_free_pe PEs");
-        overall_limit_pe(\$vg_more_free_pe);
         $more_pe += $vg_more_free_pe;
         target_cmd_root($ho, "lvextend -i1 -l +$vg_more_free_pe $lv");
     }
Signature · 1 line
2.5.1
Acked-by on v1 1/1
#1 lore raw

Ian Campbell writes ("[PATCH OSSTEST] ts-xen-build-prep: don't attempt to extend volume group by 0."):

Quoted 6 lines

overall_limit_pe can set its argument to 0 if the VG is already as large as it is allowed to be.

In which case we would end up passing "-l +0" to lvextend, which it complains about and then fails.

Quoted 7 lines

Move the clamping of $vg_more_free_pe to outside the check for it being 0.

Based on a patch by Robert Ho.

(again, I think...)