From: Przemyslaw Czarnowski Date: Mon, 20 Dec 2010 22:11:34 +0000 (+1100) Subject: fix: incremental for bare disks returns invalid value X-Git-Tag: mdadm-3.2~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8659d089983ff315c2322f904523b72fd2bccfc2;p=thirdparty%2Fmdadm.git fix: incremental for bare disks returns invalid value return value should remain the same as result of Manage_Subdevs (last significant operation). Right now it is inverted what results in error status for successful operation. Signed-off-by: NeilBrown --- diff --git a/Incremental.c b/Incremental.c index 8c5076f9..a4ac1b58 100644 --- a/Incremental.c +++ b/Incremental.c @@ -834,7 +834,7 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol, * If st is set, then only arrays of that type are considered * Return 0 on success, or some exit code on failure, probably 1. */ - int rv = -1; + int rv = 1; struct stat stb; struct map_ent *mp, *map = NULL; struct mdinfo *chosen = NULL; @@ -1002,7 +1002,7 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol, } sysfs_free(chosen); } - return rv ? 0 : 1; + return rv; } static int partition_try_spare(char *devname, int *dfdp, struct dev_policy *pol,