printf("MD_UUID=%s\n", nbuf+5);
mp = map_by_uuid(&map, info->uuid);
if (mp && mp->path &&
- strncmp(mp->path, "/dev/md/", 8) == 0)
- printf("MD_DEVNAME=%s\n", mp->path+8);
+ strncmp(mp->path, "/dev/md/", 8) == 0) {
+ printf("MD_DEVNAME=");
+ print_escape(mp->path+8);
+ putchar('\n');
+ }
if (st->ss->export_detail_super)
st->ss->export_detail_super(st);
printf("MD_UUID=%s\n", nbuf+5);
}
if (mp && mp->path &&
- strncmp(mp->path, "/dev/md/", 8) == 0)
- printf("MD_DEVNAME=%s\n", mp->path+8);
+ strncmp(mp->path, "/dev/md/", 8) == 0) {
+ printf("MD_DEVNAME=");
+ print_escape(mp->path+8);
+ putchar('\n');
+ }
}
goto out;
}
printf(" State : %s%s%s%s%s%s \n",
(array.state&(1<<MD_SB_CLEAN))?"clean":"active", st,
- (!e || (e->percent < 0 && e->percent != PROCESS_PENDING &&
- e->percent != PROCESS_DELAYED)) ? "" : sync_action[e->resync],
+ (!e || (e->percent < 0 && e->percent != RESYNC_PENDING &&
+ e->percent != RESYNC_DELAYED)) ? "" : sync_action[e->resync],
larray_size ? "": ", Not Started",
- e->percent == PROCESS_DELAYED ? " (DELAYED)": "",
- e->percent == PROCESS_PENDING ? " (PENDING)": "");
+ e->percent == RESYNC_DELAYED ? " (DELAYED)": "",
+ e->percent == RESYNC_PENDING ? " (PENDING)": "");
}
if (array.raid_disks)
printf(" Active Devices : %d\n", array.active_disks);
}
free_mdstat(ms);
- if (st->sb && info->reshape_active) {
+ if ((st && st->sb) && (info && info->reshape_active)) {
#if 0
This is pretty boring
printf(" Reshape pos'n : %llu%s\n", (unsigned long long) info->reshape_progress<<9,
if (disk.state & (1<<MD_DISK_REMOVED)) printf(" removed");
if (disk.state & (1<<MD_DISK_WRITEMOSTLY)) printf(" writemostly");
if ((disk.state &
- ((1<<MD_DISK_ACTIVE)|(1<<MD_DISK_SYNC)|(1<<MD_DISK_REMOVED)))
+ ((1<<MD_DISK_ACTIVE)|(1<<MD_DISK_SYNC)
+ |(1<<MD_DISK_REMOVED)|(1<<MD_DISK_FAULTY)))
== 0) {
printf(" spare");
if (is_26) {
if (spares && brief && array.raid_disks) printf(" spares=%d", spares);
if (brief && st && st->sb)
st->ss->brief_detail_super(st);
- st->ss->free_super(st);
+ if (st)
+ st->ss->free_super(st);
if (brief > 1 && devices) printf("\n devices=%s", devices);
if (brief) printf("\n");