From: NeilBrown Date: Thu, 22 Dec 2011 22:04:59 +0000 (+1100) Subject: ddf: fix auto-allocation problem. X-Git-Tag: mdadm-3.2.3~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b80ad6af2a1ae027eed140010c4d4e160bfe1f9;p=thirdparty%2Fmdadm.git ddf: fix auto-allocation problem. We need to check every disk to see if it has a particular amount of space spare, not just every subsequent disk. Signed-off-by: NeilBrown --- diff --git a/super-ddf.c b/super-ddf.c index d3f8b293..b5b0b422 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -2557,7 +2557,7 @@ static int reserve_space(struct supertype *st, int raiddisks, continue; /* This is bigger than 'size', see if there are enough */ cnt = 0; - for (dl2 = dl; dl2 ; dl2=dl2->next) + for (dl2 = ddf->dlist; dl2 ; dl2=dl2->next) if (dl2->esize >= dl->esize) cnt++; if (cnt >= raiddisks)