From: NeilBrown Date: Tue, 7 Feb 2012 03:06:44 +0000 (+1100) Subject: Assemble: fix --force assemble during reshape. X-Git-Tag: mdadm-3.2.4~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da8fe5aa9bd9fbb2118c073f138d9e6c1d17dbfc;p=thirdparty%2Fmdadm.git Assemble: fix --force assemble during reshape. If we have to --force assembly during reshape, we need to check by the 'before' and 'after' cases to make sure there are enough devices. Reported-by: Richard Herd <2001oddity@gmail.com> Signed-off-by: NeilBrown --- diff --git a/Assemble.c b/Assemble.c index 972398e5..ad4eb9c6 100644 --- a/Assemble.c +++ b/Assemble.c @@ -963,9 +963,17 @@ int Assemble(struct supertype *st, char *mddev, } } free(devmap); - while (force && !enough(content->array.level, content->array.raid_disks, - content->array.layout, 1, - avail)) { + while (force && + (!enough(content->array.level, content->array.raid_disks, + content->array.layout, 1, + avail) + || + (content->reshape_active && content->delta_disks > 0 && + !enough(content->array.level, (content->array.raid_disks + - content->delta_disks), + content->new_layout, 1, + avail) + ))) { /* Choose the newest best drive which is * not up-to-date, update the superblock * and add it.