]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: fix, the second array need to have the whole available space on devices
authorLabun, Marcin <Marcin.Labun@intel.com>
Fri, 27 Jan 2012 15:28:36 +0000 (15:28 +0000)
committerNeilBrown <neilb@suse.de>
Mon, 30 Jan 2012 01:21:13 +0000 (12:21 +1100)
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 <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index 8d67a141409e0b0711e1eb1ff5151bed769109fd..eba11d618621055fa4954cbe946b4c6cab5dee35 100644 (file)
@@ -6029,8 +6029,15 @@ static int reserve_space(struct supertype *st, int raiddisks,
                        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)