]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: Use successfully loaded metadata only
authorAdam Kwolek <adam.kwolek@intel.com>
Thu, 14 Apr 2011 07:50:17 +0000 (17:50 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 14 Apr 2011 07:50:17 +0000 (17:50 +1000)
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 <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index d4308bcf3811d55ba14f4ef6d62f3fd558746826..017a79dbda49b5e3f2b64b469e7c62111617170d 100644 (file)
--- 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) {