Re: [PATCH 1/3] mdadm/Grow: fix the broken raid level conversion

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

 



On Mon, Oct 09 2017, Zhilong Liu wrote:

> To fix the commit: 4b74a905a67e
> (mdadm/grow: Component size must be larger than chunk size)
> Since cannot change component size at the same time as other
> changes, ensure the 'level' is UnSet when changing component
> size, and also not affect the raid level conversion.
>
> Signed-off-by: Zhilong Liu <zlliu@xxxxxxxx>
> ---
>  Grow.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Grow.c b/Grow.c
> index 1149753..180fd78 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -1814,7 +1814,8 @@ int Grow_reshape(char *devname, int fd,
>  	}
>  
>  	if (array.level > 1 &&
> -	   (array.chunk_size / 1024) > (int)s->size) {
> +	   (array.chunk_size / 1024) > (int)s->size &&
> +	    s->level == UnSet) {
>  		pr_err("component size must be larger than chunk size.\n");
>  		return 1;
>  	}

This patch doesn't make any sense to me.
If the chunk_size is meaningful, then is must be less than the new
s->size.
This is true whether the level is being changed or not.

Why do you think that the component size cannot be changed at the same
time as other changes?

NeilBrown

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux