diff options
author | NeilBrown <neilb@suse.de> | 2009-04-02 13:37:34 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-04-02 13:37:34 +1100 |
commit | 97320d7ca4a4bba8823d87ca655c4ede4e7b3523 (patch) | |
tree | 950a75ab306db2d94a885865b81baf414381cd08 /super-ddf.c | |
parent | 37353437daabcf05eb389782f61b90ae181b8979 (diff) | |
download | mdadm-97320d7ca4a4bba8823d87ca655c4ede4e7b3523.tar.gz mdadm-97320d7ca4a4bba8823d87ca655c4ede4e7b3523.tar.xz mdadm-97320d7ca4a4bba8823d87ca655c4ede4e7b3523.zip |
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@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r-- | 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) { |