All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 2/3] dm-raid1: add cancel_presuspend function
@ 2010-01-19 20:41 Takahiro Yasui
  0 siblings, 0 replies; only message in thread
From: Takahiro Yasui @ 2010-01-19 20:41 UTC (permalink / raw)
  To: device-mapper development

When suspend is interrupted after presuspend procedure, mirror target
needs to reset and release following variables:
  - reset ms->suspend flag
  - release semaphore (rh->recovery_count)


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

Index: linux-2.6.33-rc1-dm/drivers/md/dm-raid1.c
===================================================================
--- linux-2.6.33-rc1-dm.orig/drivers/md/dm-raid1.c
+++ linux-2.6.33-rc1-dm/drivers/md/dm-raid1.c
@@ -1311,6 +1311,14 @@ static void mirror_postsuspend(struct dm
 		DMWARN("log postsuspend failed");
 }
 
+static void mirror_cancel_presuspend(struct dm_target *ti)
+{
+	struct mirror_set *ms = ti->private;
+
+	atomic_set(&ms->suspend, 0);
+	dm_rh_start_recovery(ms->rh);
+}
+
 static void mirror_resume(struct dm_target *ti)
 {
 	struct mirror_set *ms = ti->private;
@@ -1412,6 +1420,7 @@ static struct target_type mirror_target 
 	.end_io	 = mirror_end_io,
 	.presuspend = mirror_presuspend,
 	.postsuspend = mirror_postsuspend,
+	.cancel_presuspend = mirror_cancel_presuspend,
 	.resume	 = mirror_resume,
 	.status	 = mirror_status,
 	.iterate_devices = mirror_iterate_devices,

-- 
Takahiro Yasui
Hitachi Computer Products (America), Inc.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-19 20:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-19 20:41 [RFC][PATCH 2/3] dm-raid1: add cancel_presuspend function 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.