All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] monitor: Make sure that last_checkpoint is set to 0 after sync
@ 2016-06-16  9:12 Pawel Baldysiak
  2016-06-16 17:55 ` Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Pawel Baldysiak @ 2016-06-16  9:12 UTC (permalink / raw)
  To: jes.sorensen
  Cc: linux-raid, artur.paszkiewicz, aleksey.obitotskiy,
	tomasz.majchrzak

In a case of successful completion of a resync (in the last step)
- read_and_act sometimes still reads sync_action as "resync"
but sync_completed already is set to component_size.
When this race occurs, sync operation is
marked as finished, but last_checkpoint is
overwritten with sync_completed. It will cause next
sync operation (ie. reshape) to be reported as complete immediately
after start - mdmon will write successful completion of the reshape
to metadata. This patch sets last_checkpoint to 0 once the sync
is completed to stop it happening.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
---
 monitor.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/monitor.c b/monitor.c
index 870cc1a..4c79ce2 100644
--- a/monitor.c
+++ b/monitor.c
@@ -420,6 +420,9 @@ static int read_and_act(struct active_array *a)
 	if (sync_completed > a->last_checkpoint)
 		a->last_checkpoint = sync_completed;
 
+	if (sync_completed >= a->info.component_size)
+		a->last_checkpoint = 0;
+
 	a->container->ss->sync_metadata(a->container);
 	dprintf("(%d): state:%s action:%s next(", a->info.container_member,
 		array_states[a->curr_state], sync_actions[a->curr_action]);


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] monitor: Make sure that last_checkpoint is set to 0 after sync
  2016-06-16  9:12 [PATCH] monitor: Make sure that last_checkpoint is set to 0 after sync Pawel Baldysiak
@ 2016-06-16 17:55 ` Jes Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2016-06-16 17:55 UTC (permalink / raw)
  To: Pawel Baldysiak
  Cc: linux-raid, artur.paszkiewicz, aleksey.obitotskiy,
	tomasz.majchrzak

Pawel Baldysiak <pawel.baldysiak@intel.com> writes:
> In a case of successful completion of a resync (in the last step)
> - read_and_act sometimes still reads sync_action as "resync"
> but sync_completed already is set to component_size.
> When this race occurs, sync operation is
> marked as finished, but last_checkpoint is
> overwritten with sync_completed. It will cause next
> sync operation (ie. reshape) to be reported as complete immediately
> after start - mdmon will write successful completion of the reshape
> to metadata. This patch sets last_checkpoint to 0 once the sync
> is completed to stop it happening.
>
> Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
> ---
>  monitor.c |    3 +++
>  1 file changed, 3 insertions(+)

Applied!

Thanks,
Jes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-16 17:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16  9:12 [PATCH] monitor: Make sure that last_checkpoint is set to 0 after sync Pawel Baldysiak
2016-06-16 17:55 ` Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.