All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takahiro Yasui <tyasui@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Cc: k-ueda@ct.jp.nec.com, LVM2 development <lvm-devel@redhat.com>
Subject: [RFC][PATCH 4/4] cmirror: update resume method for interruption of presuspend
Date: Tue, 23 Feb 2010 13:45:14 -0500	[thread overview]
Message-ID: <4B84223A.7030304@redhat.com> (raw)

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

WARNING: multiple messages have this Message-ID (diff)
From: Takahiro Yasui <tyasui@redhat.com>
To: lvm-devel@redhat.com
Subject: [RFC][PATCH 4/4] cmirror: update resume method for interruption of presuspend
Date: Tue, 23 Feb 2010 13:45:14 -0500	[thread overview]
Message-ID: <4B84223A.7030304@redhat.com> (raw)

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;
 }
 



             reply	other threads:[~2010-02-23 18:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-23 18:45 Takahiro Yasui [this message]
2010-02-23 18:45 ` [RFC][PATCH 4/4] cmirror: update resume method for interruption of presuspend Takahiro Yasui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B84223A.7030304@redhat.com \
    --to=tyasui@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=k-ueda@ct.jp.nec.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.