summaryrefslogtreecommitdiff
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-12-16 09:07:52 +1100
committerNeilBrown <neilb@suse.de>2010-12-16 09:07:52 +1100
commitd18bfbe3d0343ac735a4f35c122de7c48a2915ac (patch)
tree4ab96d5d3ec6734ec4c4156311cb8288ae108c26 /Grow.c
parent47eb4d5a180a2fc0cdf25c82ce35b5bd5f23c712 (diff)
Grow: make sure rv is set correctly in reshape_container_raid_disks
Whenever there is an error, rv must be -1. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Grow.c b/Grow.c
index 4257acca..40b4809a 100644
--- a/Grow.c
+++ b/Grow.c
@@ -692,6 +692,7 @@ static int reshape_container_raid_disks(char *container, int raid_disks)
if (!is_container_member(e, container))
continue;
+ rv = -1;
level = map_name(pers, e->level);
if (level == 0) {
sub = sysfs_read(-1, e->devnum, GET_VERSION);
@@ -711,11 +712,10 @@ static int reshape_container_raid_disks(char *container, int raid_disks)
sysfs_free(sub);
level = 4;
}
-
+ rv = -1;
sub = NULL;
switch (level) {
default:
- rv = -1;
break;
case 6:
parity_disks++;
@@ -740,6 +740,7 @@ static int reshape_container_raid_disks(char *container, int raid_disks)
err = errno;
break;
}
+ rv = -1;
/* fall through */
case 1:
if (!sub)