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>
This commit is contained in:
Lukasz Dorau 2012-09-14 16:20:31 +02:00 committed by NeilBrown
parent 51d4261ca9
commit 65d0b4ce2d
1 changed files with 7 additions and 0 deletions

View File

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