if (get_dev_size(fd, devname, &dsize) == 0)
return 1;
+ if (test_partition(fd))
+ /* DDF is not allowed on partitions */
+ return 1;
+
/* 32M is a lower bound */
if (dsize <= 32*1024*1024) {
if (devname)
}
if (st->subarray[0]) {
+ unsigned long val;
struct vcl *v;
+ char *ep;
+
+ val = strtoul(st->subarray, &ep, 10);
+ if (*ep != '\0') {
+ free(super);
+ return 1;
+ }
for (v = super->conflist; v; v = v->next)
- if (v->vcnum == atoi(st->subarray))
+ if (v->vcnum == val)
super->currentconf = v;
if (!super->currentconf) {
free(super);
* the hostname
*/
struct ddf_super *ddf = st->sb;
- int len = strlen(homehost);
+ int len;
+
+ if (!homehost)
+ return 0;
+ len = strlen(homehost);
return (memcmp(ddf->controller.guid, T10, 8) == 0 &&
len < sizeof(ddf->controller.vendor_data) &&
info->disk.state = (1 << MD_DISK_SYNC) | (1 << MD_DISK_ACTIVE);
+ info->recovery_start = MaxSector;
info->reshape_active = 0;
info->name[0] = 0;
info->container_member = ddf->currentconf->vcnum;
+ info->recovery_start = MaxSector;
info->resync_start = 0;
+ info->reshape_active = 0;
if (!(ddf->virt->entries[info->container_member].state
& DDF_state_inconsistent) &&
(ddf->virt->entries[info->container_member].init_state
memset(pd, 0xff, pdsize);
memset(pd, 0, sizeof(*pd));
- pd->magic = DDF_PHYS_DATA_MAGIC;
+ pd->magic = DDF_PHYS_RECORDS_MAGIC;
pd->used_pdes = __cpu_to_be16(0);
pd->max_pdes = __cpu_to_be16(max_phys_disks);
memset(pd->pad, 0xff, 52);
/* FIXME I need to close the fds! */
return 0;
- } else
+ } else {
+ struct dl *d;
+ for (d = ddf->dlist; d; d=d->next)
+ while (Kill(d->devname, NULL, 0, 1, 1) == 0);
return __write_init_super_ddf(st, 1);
+ }
}
#endif
return 1;
}
if (st->subarray[0]) {
+ unsigned long val;
struct vcl *v;
+ char *ep;
+
+ val = strtoul(st->subarray, &ep, 10);
+ if (*ep != '\0') {
+ free(super);
+ return 1;
+ }
for (v = super->conflist; v; v = v->next)
- if (v->vcnum == atoi(st->subarray))
+ if (v->vcnum == val)
super->currentconf = v;
- if (!super->currentconf)
+ if (!super->currentconf) {
+ free(super);
return 1;
+ }
}
+
*sbp = super;
if (st->ss == NULL) {
st->ss = &super_ddf;