NeilBrown: ddf: fix bug with error returns.

Martin F. Krafft madduck at alioth.debian.org
Thu May 7 12:11:33 UTC 2009


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

Author: NeilBrown <neilb at suse.de>
Date:   Thu Apr  2 13:37:34 2009 +1100

ddf: fix bug with error returns.

In some cases we should only print an error message if
'devname' is defined.  In fact we were only returning
the error at all in that case!!

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

---

 super-ddf.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/super-ddf.c b/super-ddf.c
index 6455dee..11a3bac 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -781,22 +781,20 @@ static int load_super_ddf(struct supertype *st, int fd,
 
 	/* 32M is a lower bound */
 	if (dsize <= 32*1024*1024) {
-		if (devname) {
+		if (devname)
 			fprintf(stderr,
 				Name ": %s is too small for ddf: "
 				"size is %llu sectors.\n",
 				devname, dsize>>9);
-			return 1;
-		}
+		return 1;
 	}
 	if (dsize & 511) {
-		if (devname) {
+		if (devname)
 			fprintf(stderr,
 				Name ": %s is an odd size for ddf: "
 				"size is %llu bytes.\n",
 				devname, dsize);
-			return 1;
-		}
+		return 1;
 	}
 
 	if (posix_memalign((void**)&super, 512, sizeof(*super))!= 0) {




More information about the pkg-mdadm-commits mailing list