newcrc = crc32(0, buf, len);
ddf->crc = oldcrc;
- return newcrc;
+ /* The crc is store (like everything) bigendian, so convert
+ * here for simplicity
+ */
+ return __cpu_to_be32(newcrc);
}
static int load_ddf_header(int fd, unsigned long long lba,
char nbuf[64];
getinfo_super_ddf(st, &info);
fname_from_uuid(st, &info, nbuf, ':');
- printf("ARRAY /dev/ddf metadata=ddf UUID=%s\n", nbuf + 5);
+ printf("ARRAY metadata=ddf UUID=%s\n", nbuf + 5);
}
static void detail_super_ddf(struct supertype *st, char *homehost)
mppe * (sizeof(__u32) + sizeof(__u64)));
} else {
/* A new VD_CONF */
+ if (!update->space)
+ return;
vcl = update->space;
update->space = NULL;
vcl->next = ddf->conflist;
struct ddf_super *ddf = st->sb;
__u32 *magic = (__u32*)update->buf;
if (*magic == DDF_VD_CONF_MAGIC)
- posix_memalign(&update->space, 512,
+ if (posix_memalign(&update->space, 512,
offsetof(struct vcl, conf)
- + ddf->conf_rec_len * 512);
+ + ddf->conf_rec_len * 512) != 0)
+ update->space = NULL;
}
/*