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 <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-04-14 17:50:17 +10:00 committed by NeilBrown
parent 2cf3112111
commit 77f8d358b5
1 changed files with 1 additions and 1 deletions

2
Grow.c
View File

@ -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) {