All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Enhance stripe size validation
@ 2014-02-21  5:52 Wang Shilong
  2014-02-21 12:26 ` Zdenek Kabelac
  0 siblings, 1 reply; 3+ messages in thread
From: Wang Shilong @ 2014-02-21  5:52 UTC (permalink / raw)
  To: lvm-devel

From: Zhiqing Zhang <zhangzq.fnst@cn.fujitsu.com>

While stripe size is twice the physical extent size, the original code will not
reduce stripe size to maximum(physical extent size).

Signed-off-by: Zhiqing Zhang <zhangzq.fnst@cn.fujitsu.com>
---
 lib/metadata/lv_manip.c |    2 +-
 man/lvresize.8.in       |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 2b1cdcc..14ad884 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -3394,7 +3394,7 @@ static int _validate_stripesize(struct cmd_context *cmd,
 
 	if (!(vg->fid->fmt->features & FMT_SEGMENTS))
 		log_warn("Varied stripesize not supported. Ignoring.");
-	else if (lp->ac_stripesize_value > (uint64_t) vg->extent_size * 2) {
+	else if (lp->ac_stripesize_value >= (uint64_t) vg->extent_size * 2) {
 		log_error("Reducing stripe size %s to maximum, "
 			  "physical extent size %s",
 			  display_size(cmd,lp->ac_stripesize_value),
diff --git a/man/lvresize.8.in b/man/lvresize.8.in
index 3606762..f746307 100644
--- a/man/lvresize.8.in
+++ b/man/lvresize.8.in
@@ -88,7 +88,9 @@ Defaults to whatever the last segment of the Logical Volume uses.
 Not applicable to LVs using the original metadata LVM format, which
 must use a single value throughout.
 .br
-StripeSize must be 2^n (n = 2 to 9).
+StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format.
+For metadata in LVM2 format, the stripe size may be a larger
+power of 2 but must not exceed the physical extent size.
 .TP
 .B \-\-noudevsync
 Disable udev synchronisation. The
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] Enhance stripe size validation
  2014-02-21  5:52 [PATCH] Enhance stripe size validation Wang Shilong
@ 2014-02-21 12:26 ` Zdenek Kabelac
  2014-02-25  9:53   ` Zhang Zhiqing
  0 siblings, 1 reply; 3+ messages in thread
From: Zdenek Kabelac @ 2014-02-21 12:26 UTC (permalink / raw)
  To: lvm-devel

Dne 21.2.2014 06:52, Wang Shilong napsal(a):
> From: Zhiqing Zhang <zhangzq.fnst@cn.fujitsu.com>
>
> While stripe size is twice the physical extent size, the original code will not
> reduce stripe size to maximum(physical extent size).
>
> Signed-off-by: Zhiqing Zhang <zhangzq.fnst@cn.fujitsu.com>
> ---
>   lib/metadata/lv_manip.c |    2 +-
>   man/lvresize.8.in       |    4 +++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
> index 2b1cdcc..14ad884 100644
> --- a/lib/metadata/lv_manip.c
> +++ b/lib/metadata/lv_manip.c
> @@ -3394,7 +3394,7 @@ static int _validate_stripesize(struct cmd_context *cmd,
>
>   	if (!(vg->fid->fmt->features & FMT_SEGMENTS))
>   		log_warn("Varied stripesize not supported. Ignoring.");
> -	else if (lp->ac_stripesize_value > (uint64_t) vg->extent_size * 2) {
> +	else if (lp->ac_stripesize_value >= (uint64_t) vg->extent_size * 2) {
>   		log_error("Reducing stripe size %s to maximum, "
>   			  "physical extent size %s",
>   			  display_size(cmd,lp->ac_stripesize_value),

I assume the condition should have been:

(lp->ac_stripesize_value > (uint64_t) vg->extent_size)


Let me check  what is in sectors and what has wrong units...


Zdenek



> diff --git a/man/lvresize.8.in b/man/lvresize.8.in
> index 3606762..f746307 100644
> --- a/man/lvresize.8.in
> +++ b/man/lvresize.8.in
> @@ -88,7 +88,9 @@ Defaults to whatever the last segment of the Logical Volume uses.
>   Not applicable to LVs using the original metadata LVM format, which
>   must use a single value throughout.
>   .br
> -StripeSize must be 2^n (n = 2 to 9).
> +StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format.
> +For metadata in LVM2 format, the stripe size may be a larger
> +power of 2 but must not exceed the physical extent size.
>   .TP
>   .B \-\-noudevsync
>   Disable udev synchronisation. The
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Enhance stripe size validation
  2014-02-21 12:26 ` Zdenek Kabelac
@ 2014-02-25  9:53   ` Zhang Zhiqing
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang Zhiqing @ 2014-02-25  9:53 UTC (permalink / raw)
  To: lvm-devel

In this condition,  (lp->ac_stripesize_value >= (uint64_t) vg->extent_size * 2) equals to (lp->ac_stripesize_value > (uint64_t) vg->extent_size). But the latter is concise, so I'll revise it.

Thanks,
Zhiqing, Zhang

-----Original Message-----
From: lvm-devel-bounces@redhat.com [mailto:lvm-devel-bounces at redhat.com] On Behalf Of Zdenek Kabelac
Sent: Friday, February 21, 2014 8:26 PM
To: LVM2 development
Cc: zhangzq.fnst at cn.fujitsu.com
Subject: Re: [lvm-devel] [PATCH] Enhance stripe size validation

Dne 21.2.2014 06:52, Wang Shilong napsal(a):
> From: Zhiqing Zhang <zhangzq.fnst@cn.fujitsu.com>
>
> While stripe size is twice the physical extent size, the original code 
> will not reduce stripe size to maximum(physical extent size).
>
> Signed-off-by: Zhiqing Zhang <zhangzq.fnst@cn.fujitsu.com>
> ---
>   lib/metadata/lv_manip.c |    2 +-
>   man/lvresize.8.in       |    4 +++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 
> 2b1cdcc..14ad884 100644
> --- a/lib/metadata/lv_manip.c
> +++ b/lib/metadata/lv_manip.c
> @@ -3394,7 +3394,7 @@ static int _validate_stripesize(struct 
> cmd_context *cmd,
>
>   	if (!(vg->fid->fmt->features & FMT_SEGMENTS))
>   		log_warn("Varied stripesize not supported. Ignoring.");
> -	else if (lp->ac_stripesize_value > (uint64_t) vg->extent_size * 2) {
> +	else if (lp->ac_stripesize_value >= (uint64_t) vg->extent_size * 2) 
> +{
>   		log_error("Reducing stripe size %s to maximum, "
>   			  "physical extent size %s",
>   			  display_size(cmd,lp->ac_stripesize_value),

I assume the condition should have been:

(lp->ac_stripesize_value > (uint64_t) vg->extent_size)


Let me check  what is in sectors and what has wrong units...


Zdenek



> diff --git a/man/lvresize.8.in b/man/lvresize.8.in index 
> 3606762..f746307 100644
> --- a/man/lvresize.8.in
> +++ b/man/lvresize.8.in
> @@ -88,7 +88,9 @@ Defaults to whatever the last segment of the Logical Volume uses.
>   Not applicable to LVs using the original metadata LVM format, which
>   must use a single value throughout.
>   .br
> -StripeSize must be 2^n (n = 2 to 9).
> +StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format.
> +For metadata in LVM2 format, the stripe size may be a larger power of 
> +2 but must not exceed the physical extent size.
>   .TP
>   .B \-\-noudevsync
>   Disable udev synchronisation. The
>

--
lvm-devel mailing list
lvm-devel at redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-25  9:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-21  5:52 [PATCH] Enhance stripe size validation Wang Shilong
2014-02-21 12:26 ` Zdenek Kabelac
2014-02-25  9:53   ` Zhang Zhiqing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.