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 | 11 +++++++++++ mdmon.h | 1 + monitor.c | 4 ++++ 3 files changed, 16 insertions(+), 0 deletions(-) diff --git a/managemon.c b/managemon.c index c48b114..dda9d95 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, @@ -463,6 +464,15 @@ 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 { @@ -608,6 +618,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 6f8b439..eff4988 100644 --- a/mdmon.h +++ b/mdmon.h @@ -49,6 +49,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 6191886..b5cd3c6 100644 --- a/monitor.c +++ b/monitor.c @@ -305,6 +305,10 @@ 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