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);
(ddf->anchor.guid+16));
info->array.utime = 0;
info->array.chunk_size = 0;
+ info->container_enough = 0;
info->disk.major = 0;
int seq;
char nm[20];
int dfd;
- int devnum = fd2devnum(fd);
- enum sysfs_read_flags flags;
- flags = GET_LEVEL|GET_VERSION|GET_DEVS|GET_STATE;
- if (mdmon_running(devnum))
- flags |= SKIP_GONE_DEVS;
-
- sra = sysfs_read(fd, 0, flags);
+ sra = sysfs_read(fd, 0, GET_LEVEL|GET_VERSION|GET_DEVS|GET_STATE);
if (!sra)
return 1;
if (sra->array.major_version != -1 ||
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;