Re: [PATCH] fix: imsm: do not accept too small sizes

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

 



On Fri, 14 Sep 2012 16:20:31 +0200 Lukasz Dorau <lukasz.dorau@xxxxxxxxx>
wrote:

> Inappriopriate error messages (e.g. mdadm: platform does not support
> raid5 with 0 disk) have been displayed when too small size was given.
> This patch fixes it.
> 
> Signed-off-by: Lukasz Dorau <lukasz.dorau@xxxxxxxxx>
> ---
>  super-intel.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/super-intel.c b/super-intel.c
> index 1d36613..107550f 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -9744,6 +9744,13 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
>  				    get_imsm_raid_level(dev->vol.map),
>  				    chunk * 1024,
>  				    geo->size * 2);
> +		if (geo->size == 0) {
> +			pr_err("Error. Size expansion is " \
> +				   "supported only (current size is %llu, " \
> +				   "requested size /rounded/ is 0).\n",
> +				   current_size);
> +			goto analyse_change_exit;
> +		}
>  	}
>  
>  	if ((current_size != geo->size) && (geo->size > 0)) {

Applied, thanks.

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