X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=blobdiff_plain;f=Detail.c;h=25b31c48aa0cd22da644abd96993b58ddf854fe0;hp=89ad02f3075254f1e9d9d4d19347299f3504c0d8;hb=bed256c2419986e3a935680a7ead1def11ea08e7;hpb=4027ddcaa4b613a2ac2e6aa4eb0b157d7708f156 diff --git a/Detail.c b/Detail.c index 89ad02f3..25b31c48 100644 --- a/Detail.c +++ b/Detail.c @@ -54,6 +54,7 @@ int Detail(char *dev, int brief, int test) int failed = 0; struct supertype *st = NULL; int max_disks = MD_SB_DISKS; + struct mdinfo info; void *super = NULL; int rv = test ? 4 : 1; @@ -113,7 +114,6 @@ int Detail(char *dev, int brief, int test) int fd2 = dev_open(dv, O_RDONLY); if (fd2 >=0 && st && st->ss->load_super(st, fd2, &super, NULL) == 0) { - struct mdinfo info; st->ss->getinfo_super(&info, super); if (info.array.ctime != array.ctime || info.array.level != array.level) { @@ -223,11 +223,47 @@ int Detail(char *dev, int brief, int test) } if (e && e->percent >= 0) { - printf(" Rebuild Status : %d%% complete\n\n", e->percent); + printf(" Re%s Status : %d%% complete\n", + (super && info.reshape_active)? "shape":"build", + e->percent); is_rebuilding = 1; } free_mdstat(ms); + if (super && info.reshape_active) { +#if 0 +This is pretty boring + printf(" Reshape pos'n : %llu%s\n", (unsigned long long) info.reshape_progress<<9, + human_size(info.reshape_progress<<9)); +#endif + if (info.delta_disks > 0) + printf(" Delta Devices : %d, (%d->%d)\n", + info.delta_disks, array.raid_disks - info.delta_disks, array.raid_disks); + if (info.delta_disks < 0) + printf(" Delta Devices : %d, (%d->%d)\n", + info.delta_disks, array.raid_disks, array.raid_disks + info.delta_disks); + if (info.new_level != array.level) { + char *c = map_num(pers, info.new_level); + printf(" New Level : %s\n", c?c:"-unknown-"); + } + if (info.new_level != array.level || + info.new_layout != array.layout) { + if (info.new_level == 5) { + char *c = map_num(r5layout, info.new_layout); + printf(" New Layout : %s\n", + c?c:"-unknown-"); + } + if (info.new_level == 10) { + printf(" New Layout : near=%d, far=%d\n", + info.new_layout&255, + (info.new_layout>>8)&255); + } + } + if (info.new_chunk != array.chunk_size) + printf(" New Chunksize : %dK\n", info.new_chunk/1024); + printf("\n"); + } else if (e && e->percent >= 0) + printf("\n"); if (super && st) st->ss->detail_super(super);