[RFC][PATCH 2/3] dm-raid1: add cancel_presuspend function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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.

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

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux