]> xenbits.xensource.com Git - osstest.git/commitdiff
ts-xen-build-prep: don't attempt to extend volume group by 0.
authorIan Campbell <ian.campbell@citrix.com>
Wed, 23 Sep 2015 10:51:38 +0000 (11:51 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 25 Sep 2015 11:27:44 +0000 (12:27 +0100)
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.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Robert Ho <robert.hu@intel.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
ts-xen-build-prep

index 03ad35cb1d09719602e0fdf2064542813893eaf8..b35e91bb3a1393685698b96d1345b677f0e185a5 100755 (executable)
@@ -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");
     }