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 3/4] dm-crypt: update resume method for interruption of presuspend
Date: Tue, 23 Feb 2010 13:45:11 -0500	[thread overview]
Message-ID: <4B842237.7020202@redhat.com> (raw)

When suspend is interrupted after presuspend procedure, each
target needs to cancel all state changes done by its presuspend
procedure. As for the crypt target, there is nothing to be
canceled because the crypt target doesn't have a presuspend method.

The crypt target should skip crypt_preresume/crypt_resume method
when the target isn't suspended.


Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
---
 drivers/md/dm-crypt.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux-2.6.33-rc1-dm/drivers/md/dm-crypt.c
===================================================================
--- linux-2.6.33-rc1-dm.orig/drivers/md/dm-crypt.c
+++ linux-2.6.33-rc1-dm/drivers/md/dm-crypt.c
@@ -1314,6 +1314,10 @@ static int crypt_preresume(struct dm_tar
 {
 	struct crypt_config *cc = ti->private;
 
+	/* Just returns if the state is not "suspended". */
+	if (!dm_suspended(ti))
+		return 0;
+
 	if (!test_bit(DM_CRYPT_KEY_VALID, &cc->flags)) {
 		DMERR("aborting resume - crypt key is not set.");
 		return -EAGAIN;
@@ -1326,6 +1330,10 @@ static void crypt_resume(struct dm_targe
 {
 	struct crypt_config *cc = ti->private;
 
+	/* Just returns if the state is not "suspended". */
+	if (!dm_suspended(ti))
+		return;
+
 	clear_bit(DM_CRYPT_SUSPENDED, &cc->flags);
 }
 

--
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 3/4] dm-crypt: update resume method for interruption of presuspend
Date: Tue, 23 Feb 2010 13:45:11 -0500	[thread overview]
Message-ID: <4B842237.7020202@redhat.com> (raw)

When suspend is interrupted after presuspend procedure, each
target needs to cancel all state changes done by its presuspend
procedure. As for the crypt target, there is nothing to be
canceled because the crypt target doesn't have a presuspend method.

The crypt target should skip crypt_preresume/crypt_resume method
when the target isn't suspended.


Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
---
 drivers/md/dm-crypt.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux-2.6.33-rc1-dm/drivers/md/dm-crypt.c
===================================================================
--- linux-2.6.33-rc1-dm.orig/drivers/md/dm-crypt.c
+++ linux-2.6.33-rc1-dm/drivers/md/dm-crypt.c
@@ -1314,6 +1314,10 @@ static int crypt_preresume(struct dm_tar
 {
 	struct crypt_config *cc = ti->private;
 
+	/* Just returns if the state is not "suspended". */
+	if (!dm_suspended(ti))
+		return 0;
+
 	if (!test_bit(DM_CRYPT_KEY_VALID, &cc->flags)) {
 		DMERR("aborting resume - crypt key is not set.");
 		return -EAGAIN;
@@ -1326,6 +1330,10 @@ static void crypt_resume(struct dm_targe
 {
 	struct crypt_config *cc = ti->private;
 
+	/* Just returns if the state is not "suspended". */
+	if (!dm_suspended(ti))
+		return;
+
 	clear_bit(DM_CRYPT_SUSPENDED, &cc->flags);
 }
 



             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 3/4] dm-crypt: 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=4B842237.7020202@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.