From: Adam Kwolek Date: Thu, 14 Apr 2011 07:50:17 +0000 (+1000) Subject: FIX: Use successfully loaded metadata only X-Git-Tag: mdadm-3.2.2~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77f8d358b574797453299ca9a3094b02552d02de;p=thirdparty%2Fmdadm.git FIX: Use successfully loaded metadata only Values greater than 0, means error. We exit from loop on error with empty super-block pointer when sd pointer is valid. This cannot be detected by check condition as error. For sure we shouldn't go forward with error condition. It leads to throwing exception with core file when metadata handler wants to access non existing super-block. Signed-off-by: Adam Kwolek Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index d4308bcf..017a79db 100644 --- a/Grow.c +++ b/Grow.c @@ -2933,7 +2933,7 @@ int child_monitor(int afd, struct mdinfo *sra, struct reshape *reshape, continue; ok = st->ss->load_super(st, devfd, NULL); close(devfd); - if (ok >= 0) + if (ok == 0) break; } if (!sd) {