From: NeilBrown Date: Thu, 2 Apr 2009 02:37:34 +0000 (+1100) Subject: ddf: fix bug with error returns. X-Git-Tag: mdadm-3.0-rc1~51 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=commitdiff_plain;h=97320d7ca4a4bba8823d87ca655c4ede4e7b3523 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 --- diff --git a/super-ddf.c b/super-ddf.c index 6455deee..11a3bac9 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) {