linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix: imsm: do not accept too small sizes
@ 2012-09-14 14:20 Lukasz Dorau
  2012-09-20  2:31 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Dorau @ 2012-09-14 14:20 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, ed.ciechanowski, maciej.patelczyk

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@intel.com>
---
 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)) {


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

* Re: [PATCH] fix: imsm: do not accept too small sizes
  2012-09-14 14:20 [PATCH] fix: imsm: do not accept too small sizes Lukasz Dorau
@ 2012-09-20  2:31 ` NeilBrown
  0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2012-09-20  2:31 UTC (permalink / raw)
  To: Lukasz Dorau; +Cc: linux-raid, ed.ciechanowski, maciej.patelczyk

[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

On Fri, 14 Sep 2012 16:20:31 +0200 Lukasz Dorau <lukasz.dorau@intel.com>
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@intel.com>
> ---
>  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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

end of thread, other threads:[~2012-09-20  2:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-14 14:20 [PATCH] fix: imsm: do not accept too small sizes Lukasz Dorau
2012-09-20  2:31 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).