]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
fix: incremental for bare disks returns invalid value
authorPrzemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Mon, 20 Dec 2010 22:11:34 +0000 (09:11 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 20 Dec 2010 22:11:34 +0000 (09:11 +1100)
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 <neilb@suse.de>
Incremental.c

index 8c5076f98a37f303ab398e53eb0a85e517e84258..a4ac1b583a53af155ea7aa3716fcbdb365414b8d 100644 (file)
@@ -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,