diff options
author | Lukasz Dorau <lukasz.dorau@intel.com> | 2012-09-14 16:20:31 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-09-20 04:27:17 +0200 |
commit | 65d0b4ce2d5f98081bb456c600c27a28f5f6f54f (patch) | |
tree | c1f31320106a6ff437b83b3e8d00e9344578572c | |
parent | fix: adjust parse_size() to the unsigned size variable (diff) | |
download | mdadm-65d0b4ce2d5f98081bb456c600c27a28f5f6f54f.tar.xz mdadm-65d0b4ce2d5f98081bb456c600c27a28f5f6f54f.zip |
fix: imsm: do not accept too small sizes
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>
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | super-intel.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c index 1d366131..107550fd 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)) { |