All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 4/4] cmirror: update resume method for interruption of presuspend
@ 2010-02-23 18:45 ` Takahiro Yasui
  0 siblings, 0 replies; 2+ messages in thread
From: Takahiro Yasui @ 2010-02-23 18:45 UTC (permalink / raw)
  To: device-mapper development; +Cc: k-ueda, LVM2 development

Suspend procedure could be interrupted between presuspend and
postsuspend procedure. When it happens, all state changes done
by presuspend procedure needs to be canceled.

I proposed a kernel patch to use a resume handler for canceling
state changes and this patch fixes the cluster mirror.

Cluster mirror changes only one flag (log's recovery_halted) for
the DM_ULOG_PRESUSPEND request. Therefore, clog_resume function
needs to reset the log's recovery_halted flag if cluster mirror
received the DM_ULOG_RESUME request with the condition of log's
state is LOG_RESUMED and its recovery_halted is set.


Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
---
 daemons/cmirrord/functions.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Index: LVM2-2.02.62-20100217/daemons/cmirrord/functions.c
===================================================================
--- LVM2-2.02.62-20100217.orig/daemons/cmirrord/functions.c
+++ LVM2-2.02.62-20100217/daemons/cmirrord/functions.c
@@ -721,6 +721,10 @@ static int clog_resume(struct dm_ulog_re
 	if (!lc)
 		return -EINVAL;
 
+	/* Check if the resume is called by interrupting suspend procedure */
+	if (lc->state == LOG_RESUMED && lc->recovery_halted)
+		goto cancel_presuspend;
+
 	switch (lc->resume_override) {
 	case 1000:
 		LOG_ERROR("[%s] Additional resume issued before suspend",
@@ -825,8 +829,10 @@ out:
 		   SHORT_UUID(lc->uuid), (unsigned long long)lc->sync_count);
 	lc->sync_search = 0;
 	lc->state = LOG_RESUMED;
+
+cancel_presuspend:
 	lc->recovery_halted = 0;
-	
+
 	return rq->error;
 }
 

--
lvm-devel mailing list
lvm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel

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

* [RFC][PATCH 4/4] cmirror: update resume method for interruption of presuspend
@ 2010-02-23 18:45 ` Takahiro Yasui
  0 siblings, 0 replies; 2+ messages in thread
From: Takahiro Yasui @ 2010-02-23 18:45 UTC (permalink / raw)
  To: lvm-devel

Suspend procedure could be interrupted between presuspend and
postsuspend procedure. When it happens, all state changes done
by presuspend procedure needs to be canceled.

I proposed a kernel patch to use a resume handler for canceling
state changes and this patch fixes the cluster mirror.

Cluster mirror changes only one flag (log's recovery_halted) for
the DM_ULOG_PRESUSPEND request. Therefore, clog_resume function
needs to reset the log's recovery_halted flag if cluster mirror
received the DM_ULOG_RESUME request with the condition of log's
state is LOG_RESUMED and its recovery_halted is set.


Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
---
 daemons/cmirrord/functions.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Index: LVM2-2.02.62-20100217/daemons/cmirrord/functions.c
===================================================================
--- LVM2-2.02.62-20100217.orig/daemons/cmirrord/functions.c
+++ LVM2-2.02.62-20100217/daemons/cmirrord/functions.c
@@ -721,6 +721,10 @@ static int clog_resume(struct dm_ulog_re
 	if (!lc)
 		return -EINVAL;
 
+	/* Check if the resume is called by interrupting suspend procedure */
+	if (lc->state == LOG_RESUMED && lc->recovery_halted)
+		goto cancel_presuspend;
+
 	switch (lc->resume_override) {
 	case 1000:
 		LOG_ERROR("[%s] Additional resume issued before suspend",
@@ -825,8 +829,10 @@ out:
 		   SHORT_UUID(lc->uuid), (unsigned long long)lc->sync_count);
 	lc->sync_search = 0;
 	lc->state = LOG_RESUMED;
+
+cancel_presuspend:
 	lc->recovery_halted = 0;
-	
+
 	return rq->error;
 }
 



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

end of thread, other threads:[~2010-02-23 18:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-23 18:45 [RFC][PATCH 4/4] cmirror: update resume method for interruption of presuspend Takahiro Yasui
2010-02-23 18:45 ` Takahiro Yasui

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.