FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 02-23-2010, 05:45 PM
Takahiro Yasui
 
Default dm-crypt: update resume method for interruption of presuspend

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


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

Thread Tools




All times are GMT. The time now is 07:13 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org