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

Subsystems: the rest

STALE5124d

2 messages, 2 authors, 2012-09-20 · open the first message on its own page

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

From: Lukasz Dorau <hidden>
Date: 2012-09-14 14:20:31

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 <redacted>
---
 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)) {

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

From: NeilBrown <hidden>
Date: 2012-09-20 02:31:44

On Fri, 14 Sep 2012 16:20:31 +0200 Lukasz Dorau [off-list ref]
wrote:
quoted hunk
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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help