[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST] 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.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Robert Ho <robert.hu@xxxxxxxxx>
---
 ts-xen-build-prep | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ts-xen-build-prep b/ts-xen-build-prep
index 03ad35c..b35e91b 100755
--- a/ts-xen-build-prep
+++ b/ts-xen-build-prep
@@ -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");
     }
-- 
2.5.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.