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

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

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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