All of lore.kernel.org
 help / color / mirror / Atom feed
* [PING / RESEND] handling reservation conflicts in dm-mpath
@ 2016-08-02 12:36 Christoph Hellwig
  2016-08-02 12:36 ` [PATCH] dm-mpath: always return reservation conflict Christoph Hellwig
  0 siblings, 1 reply; 20+ messages in thread
From: Christoph Hellwig @ 2016-08-02 12:36 UTC (permalink / raw)
  To: dm-devel, linux-scsi; +Cc: hare

Hannes sent this patch a bit more than a year ago, but it got silently
dropped.  When using the pNFS SCSI layout we can easily hit a
failover "livelock" without it as the reservation conflicts on a
newly detected device that doesn't have layouts yet, or after a fency
will keep failing over from one path to another for no reason at all.

Any chance to get it into mainline now?

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH] dm-mpath: always return reservation conflict
@ 2015-07-15 11:23 Hannes Reinecke
  2015-07-15 11:35 ` James Bottomley
  0 siblings, 1 reply; 20+ messages in thread
From: Hannes Reinecke @ 2015-07-15 11:23 UTC (permalink / raw)
  To: Mike Snitzer
  Cc: Christoph Hellwig, dm-devel, linux-scsi, James Bottomley,
	Hannes Reinecke

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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-09-30  0:55 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2016-08-11 18:38   ` [dm-devel] " Christoph Hellwig
2016-08-15 13:08     ` Mike Snitzer
2016-08-15 13:40       ` Mike Snitzer
2016-09-26 16:52         ` [dm-devel] " Christoph Hellwig
2016-09-26 19:06           ` James Bottomley
2016-09-27  6:34             ` Hannes Reinecke
2016-09-27 18:50               ` James Bottomley
2016-09-29 15:01                 ` Mike Snitzer
2016-09-29 15:35                   ` Christoph Hellwig
2016-09-30  0:55                   ` James Bottomley
  -- strict thread matches above, loose matches on Subject: below --
2015-07-15 11:23 [PATCH] " Hannes Reinecke
2015-07-15 11:35 ` 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-16  5:07   ` Christophe Varoqui

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.