Incr: fix up return value in try_spare

We only want to try partition_try_spare if array_try_spare failed.
If it succeeded, there is nothing more to try.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2010-11-22 20:58:06 +11:00
parent 52e965c296
commit aaccda4406
1 changed files with 2 additions and 2 deletions

View File

@ -1112,10 +1112,10 @@ static int try_spare(char *devname, int *dfdp, struct dev_policy *pol,
policy_action_allows(pol, superlist[i]->name, act_spare))
partitions_ok = 1;
}
rv = 0;
rv = 1;
if (arrays_ok)
rv = array_try_spare(devname, dfdp, pol, st, verbose);
if (rv == 0 && partitions_ok)
if (rv != 0 && partitions_ok)
rv = partition_try_spare(devname, dfdp, pol, st, verbose);
return rv;
}