From f878b24226953f06912ebceb2c811edf36818d2f Mon Sep 17 00:00:00 2001 From: "Labun, Marcin" Date: Fri, 27 Jan 2012 15:28:36 +0000 Subject: [PATCH] imsm: fix, the second array need to have the whole available space on devices Fix the case with creating an array with given container in command line instead of real devices: mdadm -CR /dev/md/raid0 -l 0 -n 2 -z5G /dev/md/imsm Signed-off-by: Marcin Labun Signed-off-by: NeilBrown --- super-intel.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- mdadm-3.2.2.orig/super-intel.c +++ mdadm-3.2.2/super-intel.c @@ -6027,8 +6027,15 @@ static int reserve_space(struct supertyp size /= 2 * chunk; size *= 2 * chunk; } + maxsize = size; + } + if (!check_env("IMSM_NO_PLATFORM") && + mpb->num_raid_devs > 0 && size && size != maxsize) { + fprintf(stderr, Name ": attempting to create a second " + "volume with size less then remaining space. " + "Aborting...\n"); + return 0; } - cnt = 0; for (dl = super->disks; dl; dl = dl->next) if (dl->e)