All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm mpath: never re-queue request if I_T_L nexus failure and no paths
@ 2011-09-13 14:22 Mike Snitzer
  0 siblings, 0 replies; only message in thread
From: Mike Snitzer @ 2011-09-13 14:22 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: dm-devel, Mike Snitzer

Commit 751b2a7d (dm mpath: propagate target errors immediately) intended
to prevent request re-queue if I_T_L nexus failure and no paths are
available.

However, !m->queue_if_no_path does not imply !__must_push_back(m) so it
is possible that an -EBADE failure will result in requeue if
queue_if_no_path was previously enabled (but currently
!m->queue_if_no_path) and __must_push_back(m).

Fix this so requests that fail with -EBADE will never be re-queued.
Return -EIO if queue_if_no_path was really not enabled, otherwise if
queueing is enabled return -EBADE.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
 drivers/md/dm-mpath.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 5e0090e..d0297c2 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1239,13 +1239,10 @@ static int do_end_io(struct multipath *m, struct request *clone,
 
 	spin_lock_irqsave(&m->lock, flags);
 	if (!m->nr_valid_paths) {
-		if (!m->queue_if_no_path) {
-			if (!__must_push_back(m))
-				r = -EIO;
-		} else {
-			if (error == -EBADE)
-				r = error;
-		}
+		if (!m->queue_if_no_path && !__must_push_back(m))
+			r = -EIO;
+		else if (error == -EBADE)
+			r = error;
 	}
 	spin_unlock_irqrestore(&m->lock, flags);
 
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-13 14:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-13 14:22 [PATCH] dm mpath: never re-queue request if I_T_L nexus failure and no paths Mike Snitzer

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.