diff mbox

[RFC,3/4] dm-crypt: update resume method for interruption of presuspend

Message ID 4B842237.7020202@redhat.com (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Takahiro Yasui Feb. 23, 2010, 6:45 p.m. UTC
None
diff mbox

Patch

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