* Patch "dm mpath: avoid that path removal can trigger an infinite loop" has been added to the 4.11-stable tree
@ 2017-05-22 16:05 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-05-22 16:05 UTC (permalink / raw)
To: bart.vanassche, gregkh, hare, hch, snitzer; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
dm mpath: avoid that path removal can trigger an infinite loop
to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
dm-mpath-avoid-that-path-removal-can-trigger-an-infinite-loop.patch
and it can be found in the queue-4.11 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 7083abbbfc4fa706ff72d27d33a5214881979336 Mon Sep 17 00:00:00 2001
From: Bart Van Assche <bart.vanassche@sandisk.com>
Date: Thu, 27 Apr 2017 10:11:15 -0700
Subject: dm mpath: avoid that path removal can trigger an infinite loop
From: Bart Van Assche <bart.vanassche@sandisk.com>
commit 7083abbbfc4fa706ff72d27d33a5214881979336 upstream.
If blk_get_request() fails, check whether the failure is due to a path
being removed. If that is the case, fail the path by triggering a call
to fail_path(). This avoids that the following scenario can be
encountered while removing paths:
* CPU usage of a kworker thread jumps to 100%.
* Removing the DM device becomes impossible.
Delay requeueing if blk_get_request() returns -EBUSY or -EWOULDBLOCK,
and the queue is not dying, because in these cases immediate requeuing
is inappropriate.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-mpath.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -489,6 +489,7 @@ static int multipath_clone_and_map(struc
struct pgpath *pgpath;
struct block_device *bdev;
struct dm_mpath_io *mpio = get_mpio(map_context);
+ struct request_queue *q;
struct request *clone;
/* Do we need to select a new pgpath? */
@@ -511,12 +512,18 @@ static int multipath_clone_and_map(struc
mpio->nr_bytes = nr_bytes;
bdev = pgpath->path.dev->bdev;
-
- clone = blk_get_request(bdev_get_queue(bdev),
- rq->cmd_flags | REQ_NOMERGE,
- GFP_ATOMIC);
+ q = bdev_get_queue(bdev);
+ clone = blk_get_request(q, rq->cmd_flags | REQ_NOMERGE, GFP_ATOMIC);
if (IS_ERR(clone)) {
/* EBUSY, ENODEV or EWOULDBLOCK: requeue */
+ bool queue_dying = blk_queue_dying(q);
+ DMERR_LIMIT("blk_get_request() returned %ld%s - requeuing",
+ PTR_ERR(clone), queue_dying ? " (path offline)" : "");
+ if (queue_dying) {
+ atomic_inc(&m->pg_init_in_progress);
+ activate_or_offline_path(pgpath);
+ return DM_MAPIO_REQUEUE;
+ }
return DM_MAPIO_DELAY_REQUEUE;
}
clone->bio = clone->biotail = NULL;
Patches currently in stable-queue which might be from bart.vanassche@sandisk.com are
queue-4.11/dm-mpath-requeue-after-a-small-delay-if-blk_get_request-fails.patch
queue-4.11/dm-mpath-avoid-that-path-removal-can-trigger-an-infinite-loop.patch
queue-4.11/dm-mpath-split-and-rename-activate_path-to-prepare-for-its-expanded-use.patch
queue-4.11/dm-mpath-delay-requeuing-while-path-initialization-is-in-progress.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-05-22 16:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 16:05 Patch "dm mpath: avoid that path removal can trigger an infinite loop" has been added to the 4.11-stable tree gregkh
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).