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:
parent
52e965c296
commit
aaccda4406
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue