From: Mike Anderson <andmike@linux.vnet.ibm.com>
To: dm-devel@redhat.com
Subject: [PATCH 2/2] dm-mpath: Add element for suspended state.
Date: Sun, 15 Nov 2009 23:38:29 -0800 [thread overview]
Message-ID: <20091116073829.4070.45194.stgit@localhost.localdomain> (raw)
In-Reply-To: <20091116073819.4070.40173.stgit@localhost.localdomain>
Add element to multipath structure for indication of suspended state.
Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
---
drivers/md/dm-mpath.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index b102959..1f598c9 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -95,6 +95,8 @@ struct multipath {
mempool_t *mpio_pool;
struct mutex work_mutex;
+
+ unsigned int suspended;
};
/*
@@ -1274,6 +1276,7 @@ static void multipath_postsuspend(struct dm_target *ti)
struct multipath *m = (struct multipath *) ti->private;
mutex_lock(&m->work_mutex);
+ m->suspended = 1;
flush_multipath_work();
mutex_unlock(&m->work_mutex);
}
@@ -1286,6 +1289,10 @@ static void multipath_resume(struct dm_target *ti)
struct multipath *m = (struct multipath *) ti->private;
unsigned long flags;
+ mutex_lock(&m->work_mutex);
+ m->suspended = 0;
+ mutex_unlock(&m->work_mutex);
+
spin_lock_irqsave(&m->lock, flags);
m->queue_if_no_path = m->saved_queue_if_no_path;
spin_unlock_irqrestore(&m->lock, flags);
@@ -1421,6 +1428,11 @@ static int multipath_message(struct dm_target *ti, unsigned argc, char **argv)
mutex_lock(&m->work_mutex);
+ if (m->suspended) {
+ r = -EBUSY;
+ goto out;
+ }
+
if (argc == 1) {
if (!strnicmp(argv[0], MESG_STR("queue_if_no_path"))) {
r = queue_if_no_path(m, 1, 0);
next prev parent reply other threads:[~2009-11-16 7:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-16 7:38 [PATCH 0/2] dm-mpath: mutex and suspended check for messages Mike Anderson
2009-11-16 7:38 ` [PATCH 1/2] dm-mpath: Add mutex to synchronize adding and flushing work Mike Anderson
2009-11-16 9:16 ` Kiyoshi Ueda
2009-11-16 7:38 ` Mike Anderson [this message]
2009-11-16 9:17 ` [PATCH 2/2] dm-mpath: Add element for suspended state Kiyoshi Ueda
2009-11-16 13:54 ` Alasdair G Kergon
2009-11-20 7:19 ` Kiyoshi Ueda
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=20091116073829.4070.45194.stgit@localhost.localdomain \
--to=andmike@linux.vnet.ibm.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.