Reshape progress is not updated in mdmon. This patch adds reshape progress updating feature. Signed-off-by: Maciej Trela <maciej.trela@xxxxxxxxx> Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> --- managemon.c | 9 +++++++++ mdmon.h | 1 + monitor.c | 3 +++ 3 files changed, 13 insertions(+), 0 deletions(-) diff --git a/managemon.c b/managemon.c index a6e6880..5d81623 100644 --- a/managemon.c +++ b/managemon.c @@ -417,6 +417,7 @@ static void manage_member(struct mdstat_ent *mdstat, struct metadata_update *updates = NULL; struct mdinfo *newdev = NULL; struct mdinfo *d; + int delta_disks = a->reshape_delta_disks; newdev = newa->container->ss->reshape_array(newa, reshape_in_progress, &updates); if (newdev) { @@ -451,6 +452,13 @@ static void manage_member(struct mdstat_ent *mdstat, /* reshape executed */ dprintf("Reshape was started\n"); + newa->new_data_disks = newa->info.array.raid_disks + delta_disks; + if (a->info.array.level == 4) + newa->new_data_disks--; + if (a->info.array.level == 5) + newa->new_data_disks--; + if (a->info.array.level == 6) + newa->new_data_disks--; replace_array(a->container, a, newa); a = newa; } else { @@ -591,6 +599,7 @@ static void manage_new(struct mdstat_ent *mdstat, new->container = container; new->reshape_state = reshape_not_active; + new->new_data_disks = 0; inst = to_subarray(mdstat, container->devname); diff --git a/mdmon.h b/mdmon.h index b869544..b922af4 100644 --- a/mdmon.h +++ b/mdmon.h @@ -48,6 +48,7 @@ struct active_array { enum state_of_reshape reshape_state; int reshape_delta_disks; + int new_data_disks; int check_degraded; /* flag set by mon, read by manage */ diff --git a/monitor.c b/monitor.c index 1e22444..207004c 100644 --- a/monitor.c +++ b/monitor.c @@ -305,6 +305,9 @@ static int read_and_act(struct active_array *a) } } + if (a->curr_action == reshape) + a->info.reshape_progress = a->info.resync_start * a->new_data_disks; + /* finalize reshape detection */ if ((a->curr_action != reshape) && -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html