NeilBrown: Grow: goto release rather than just return

Martin F. Krafft madduck at alioth.debian.org
Wed Jan 27 02:03:26 UTC 2010


Module: mdadm
Branch: upstream
Commit: b5ea446ae7c5548b9f3d88a474dc641a6910ddaf
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=b5ea446ae7c5548b9f3d88a474dc641a6910ddaf

Author: NeilBrown <neilb at suse.de>
Date:   Fri Nov  6 15:22:14 2009 +1100

Grow: goto release rather than just return

otherwise we exit with the array frozen.

Signed-off-by: NeilBrown <neilb at suse.de>

---

 Grow.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Grow.c b/Grow.c
index 4423b78..75af6f3 100644
--- a/Grow.c
+++ b/Grow.c
@@ -644,8 +644,10 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
 				layout_str = "parity-last";
 		} else {
 			c = map_num(pers, level);
-			if (c == NULL)
-				return 1;/* not possible */
+			if (c == NULL) {
+				rv = 1;/* not possible */
+				goto release;
+			}
 			err = sysfs_set_str(sra, NULL, "level", c);
 			if (err) {
 				fprintf(stderr, Name ": %s: could not set level to %s\n",
@@ -849,7 +851,8 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
 				if (nlayout == UnSet) {
 					fprintf(stderr, Name ": layout %s not understood for raid5.\n",
 						layout_str);
-					return 1;
+					rv = 1;
+					goto release;
 				}
 				break;
 
@@ -858,7 +861,8 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
 				if (nlayout == UnSet) {
 					fprintf(stderr, Name ": layout %s not understood for raid6.\n",
 						layout_str);
-					return 1;
+					rv = 1;
+					goto release;
 				}
 				break;
 			}




More information about the pkg-mdadm-commits mailing list