All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takahiro Yasui <tyasui@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: [RFC][PATCH 2/3] dm-raid1: add cancel_presuspend function
Date: Tue, 19 Jan 2010 15:41:29 -0500	[thread overview]
Message-ID: <4B5618F9.8050103@redhat.com> (raw)

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.

                 reply	other threads:[~2010-01-19 20:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4B5618F9.8050103@redhat.com \
    --to=tyasui@redhat.com \
    --cc=dm-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.