char *avail = NULL;
int external;
int inactive;
+ int is_container = 0;
if (fd < 0) {
pr_err("cannot open %s: %s\n",
}
}
+ if (array.raid_disks == 0 && external)
+ is_container = 1;
if (fstat(fd, &stb) != 0 && !S_ISBLK(stb.st_mode))
stb.st_rdev = 0;
rv = 0;
printf("MD_LEVEL=%s\n", str);
printf("MD_DEVICES=%d\n", array.raid_disks);
} else {
- if (!inactive)
+ if (is_container)
printf("MD_LEVEL=container\n");
printf("MD_DEVICES=%d\n", array.nr_disks);
}
if (st->ss->export_detail_super)
st->ss->export_detail_super(st);
+ map_free(map);
} else {
struct map_ent *mp, *map = NULL;
char nbuf[64];
print_escape(mp->path+8);
putchar('\n');
}
+ map_free(map);
}
if (sra) {
struct mdinfo *mdi;
if (c->brief) {
mdu_bitmap_file_t bmf;
- printf("%sARRAY %s", inactive ? "INACTIVE-":"", dev);
+ if (inactive && !is_container)
+ printf("INACTIVE-ARRAY %s", dev);
+ else
+ printf("ARRAY %s", dev);
if (c->verbose > 0) {
if (array.raid_disks)
printf(" level=%s num-devices=%d",
str ? str : "-unknown-",
array.raid_disks);
- else if (!inactive)
+ else if (is_container)
printf(" level=container num-devices=%d",
array.nr_disks);
else
atime = array.ctime;
if (atime)
printf(" Creation Time : %.24s\n", ctime(&atime));
- if (array.raid_disks == 0 && external)
+ if (is_container)
str = "container";
if (str)
printf(" Raid Level : %s\n", str);
" (DELAYED)": "",
(e && e->percent == RESYNC_PENDING) ?
" (PENDING)": "");
- } else if (inactive) {
+ } else if (inactive && !is_container) {
printf(" State : inactive\n");
}
if (array.raid_disks)
printf(" %7s Status : %d%% complete\n",
sync_action[e->resync], e->percent);
}
- free_mdstat(ms);
if ((st && st->sb) && (info && info->reshape_active)) {
#if 0
printf("\n");
} else if (e && e->percent >= 0)
printf("\n");
+ free_mdstat(ms);
+
if (st && st->sb)
st->ss->detail_super(st, c->homehost);