From: NeilBrown Date: Mon, 22 Nov 2010 09:58:06 +0000 (+1100) Subject: Incr: fix up return value in try_spare X-Git-Tag: mdadm-3.2~270 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaccda440691a5f9d5c986a90333a218db1f8a6c;p=thirdparty%2Fmdadm.git 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 --- diff --git a/Incremental.c b/Incremental.c index 35ad221a..44e83ba3 100644 --- a/Incremental.c +++ b/Incremental.c @@ -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; }