Re: [Xen-devel] [OSSTest Nested v12 20/21] Don't lvextend if actually no more space to extend

2015-09-22 Thread Ian Campbell
On Wed, 2015-09-16 at 15:27 +0100, Ian Jackson wrote:
> Robert Ho writes ("[OSSTest Nested v12 20/21] Don't lvextend if actually
> no more space to extend"):
> > Though passes if judgement, the
> > overall_limit_pe(\$vg_more_free_pe);
> > may final judge no more free_pe to extend.
> > So, check if $vg_more_free_pe is 0, if so, we don't lvextend,
> > otherwise lvextend will report error on nonsense operation.
> 
> I think this should be done by moving the start of the if block to
> after overall_limit_pe.  That would avoid a tested if (and various
> other slight anomalies).

IOW move the overall_limit_pe outside the if? 

Like so:

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");
 }

(untested, but I've just tripped over this in a standalone run myself).

Ian.

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


Re: [Xen-devel] [OSSTest Nested v12 20/21] Don't lvextend if actually no more space to extend

2015-09-22 Thread Ian Jackson
Ian Campbell writes ("Re: [OSSTest Nested v12 20/21] Don't lvextend if actually 
no more space to extend"):
> On Wed, 2015-09-16 at 15:27 +0100, Ian Jackson wrote:
> > I think this should be done by moving the start of the if block to
> > after overall_limit_pe.  That would avoid a tested if (and various
> > other slight anomalies).
> 
> IOW move the overall_limit_pe outside the if? 
> 
> Like so:
> 
> 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");
>  }
> 
> (untested, but I've just tripped over this in a standalone run myself).

Yes.  With a suitable commit message:

Acked-by: Ian Jackson 

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


Re: [Xen-devel] [OSSTest Nested v12 20/21] Don't lvextend if actually no more space to extend

2015-09-16 Thread Ian Jackson
Robert Ho writes ("[OSSTest Nested v12 20/21] Don't lvextend if actually no 
more space to extend"):
> Though passes if judgement, the
>   overall_limit_pe(\$vg_more_free_pe);
> may final judge no more free_pe to extend.
> So, check if $vg_more_free_pe is 0, if so, we don't lvextend,
> otherwise lvextend will report error on nonsense operation.

I think this should be done by moving the start of the if block to
after overall_limit_pe.  That would avoid a tested if (and various
other slight anomalies).

Thanks,
Ian.

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