From: Hannes Reinecke <hare@suse.de>
To: Mike Snitzer <snitzer@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
dm-devel@redhat.com, linux-scsi@vger.kernel.org,
James Bottomley <james.bottomley@hansenpartnership.com>,
Hannes Reinecke <hare@suse.de>
Subject: [PATCH] dm-mpath: always return reservation conflict
Date: Wed, 15 Jul 2015 13:23:24 +0200 [thread overview]
Message-ID: <1436959404-14035-1-git-send-email-hare@suse.de> (raw)
If dm-mpath encounters an reservation conflict it should not
fail the path (as communication with the target is not affected)
but should rather retry on another path.
However, in doing so we might be inducing a ping-pong between
paths, with no guarantee of any forward progress.
And arguably a reservation conflict is an unexpected error,
so we should be passing it upwards to allow the application
to take appropriate steps.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/md/dm-mpath.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 5a67671..e65d266 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1269,7 +1269,16 @@ static int do_end_io(struct multipath *m, struct request *clone,
if (noretry_error(error))
return error;
- if (mpio->pgpath)
+ /*
+ * EBADE signals an reservation conflict.
+ * We shouldn't fail the path here as we can communicate with
+ * the target. We should failover to the next path, but in
+ * doing so we might be causing a ping-pong between paths.
+ * So just return the reservation conflict error.
+ */
+ if (error == -EBADE)
+ r = error;
+ else if (mpio->pgpath)
fail_path(mpio->pgpath);
spin_lock_irqsave(&m->lock, flags);
@@ -1277,9 +1286,6 @@ static int do_end_io(struct multipath *m, struct request *clone,
if (!m->queue_if_no_path) {
if (!__must_push_back(m))
r = -EIO;
- } else {
- if (error == -EBADE)
- r = error;
}
}
spin_unlock_irqrestore(&m->lock, flags);
--
1.8.5.2
next reply other threads:[~2015-07-15 11:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-15 11:23 Hannes Reinecke [this message]
2015-07-15 11:35 ` [PATCH] dm-mpath: always return reservation conflict James Bottomley
2015-07-15 11:52 ` Hannes Reinecke
2015-07-15 11:56 ` Christoph Hellwig
2015-07-15 12:02 ` Hannes Reinecke
2015-07-15 12:01 ` James Bottomley
2015-07-15 12:15 ` Hannes Reinecke
2015-07-15 13:20 ` Mike Snitzer
2015-07-16 5:07 ` [PATCH] " Christophe Varoqui
2015-07-16 7:54 ` [dm-devel] " Christoph Hellwig
2015-07-16 14:40 ` Hannes Reinecke
-- strict thread matches above, loose matches on Subject: below --
2016-08-02 12:36 [PING / RESEND] handling reservation conflicts in dm-mpath Christoph Hellwig
2016-08-02 12:36 ` [PATCH] dm-mpath: always return reservation conflict Christoph Hellwig
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=1436959404-14035-1-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=dm-devel@redhat.com \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=snitzer@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).