diff options
author | NeilBrown <neilb@suse.de> | 2010-12-16 09:07:52 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-12-16 09:07:52 +1100 |
commit | d18bfbe3d0343ac735a4f35c122de7c48a2915ac (patch) | |
tree | 4ab96d5d3ec6734ec4c4156311cb8288ae108c26 /Grow.c | |
parent | 47eb4d5a180a2fc0cdf25c82ce35b5bd5f23c712 (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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) |