All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: Fix blk_mq_try_issue_directly()
@ 2019-04-03 20:11 Bart Van Assche
  2019-04-04  7:08 ` Ming Lei
  2019-04-08  2:07 ` jianchao.wang
  0 siblings, 2 replies; 13+ messages in thread
From: Bart Van Assche @ 2019-04-03 20:11 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche,
	Christoph Hellwig, Hannes Reinecke, James Smart, Ming Lei,
	Jianchao Wang, Keith Busch, Dongli Zhang, Laurence Oberman,
	stable

If blk_mq_try_issue_directly() returns BLK_STS*_RESOURCE that means that
the request has not been queued and that the caller should retry to submit
the request. Both blk_mq_request_bypass_insert() and
blk_mq_sched_insert_request() guarantee that a request will be processed.
Hence return BLK_STS_OK if one of these functions is called. This patch
avoids that blk_mq_dispatch_rq_list() crashes when using dm-mpath.

Cc: Christoph Hellwig <hch@infradead.org>
Cc: Hannes Reinecke <hare@suse.com>
Cc: James Smart <james.smart@broadcom.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Jianchao Wang <jianchao.w.wang@oracle.com>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Dongli Zhang <dongli.zhang@oracle.com>
Cc: Laurence Oberman <loberman@redhat.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Reported-by: Laurence Oberman <loberman@redhat.com>
Fixes: 7f556a44e61d ("blk-mq: refactor the code of issue request directly") # v5.0.
Cc: <stable@vger.kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/blk-mq.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 652d0c6d5945..b2c20dce8a30 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1859,16 +1859,11 @@ blk_status_t blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
 	case BLK_STS_RESOURCE:
 		if (force) {
 			blk_mq_request_bypass_insert(rq, run_queue);
-			/*
-			 * We have to return BLK_STS_OK for the DM
-			 * to avoid livelock. Otherwise, we return
-			 * the real result to indicate whether the
-			 * request is direct-issued successfully.
-			 */
-			ret = bypass ? BLK_STS_OK : ret;
+			ret = BLK_STS_OK;
 		} else if (!bypass) {
 			blk_mq_sched_insert_request(rq, false,
 						    run_queue, false);
+			ret = BLK_STS_OK;
 		}
 		break;
 	default:
-- 
2.21.0.196.g041f5ea1cf98


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

end of thread, other threads:[~2019-04-10  0:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 20:11 [PATCH] block: Fix blk_mq_try_issue_directly() Bart Van Assche
2019-04-04  7:08 ` Ming Lei
2019-04-04 14:59   ` Bart Van Assche
2019-04-04 15:09     ` Laurence Oberman
2019-04-04 15:28       ` Bart Van Assche
2019-04-04 15:33         ` Laurence Oberman
2019-04-04 16:47         ` Laurence Oberman
2019-04-04 17:09           ` Bart Van Assche
2019-04-08  2:07 ` jianchao.wang
2019-04-08  2:36   ` jianchao.wang
2019-04-09  1:31     ` jianchao.wang
2019-04-09 12:28       ` Laurence Oberman
2019-04-10  0:51         ` jianchao.wang

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.