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>
This commit is contained in:
NeilBrown 2009-04-02 13:37:34 +11:00
parent 37353437da
commit 97320d7ca4
1 changed files with 4 additions and 6 deletions

View File

@ -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) {