From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: linux-block@vger.kernel.org
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: [PATCH] blk-mq: Call bio_io_error if request returned is NULL
Date: Mon, 13 Feb 2017 10:04:54 -0600 [thread overview]
Message-ID: <20170213160454.30869-1-rgoldwyn@suse.de> (raw)
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
If blk_mq_map_request returns NULL, bio_endio() function is not
called. Call bio_io_error() in case request returned is NULL.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
---
block/blk-mq.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 81caceb..7cd8912 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1286,8 +1286,10 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
return BLK_QC_T_NONE;
rq = blk_mq_map_request(q, bio, &data);
- if (unlikely(!rq))
+ if (unlikely(!rq)) {
+ bio_io_error(bio);
return BLK_QC_T_NONE;
+ }
cookie = blk_tag_to_qc_t(rq->tag, data.hctx->queue_num);
@@ -1381,8 +1383,10 @@ static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio)
request_count = blk_plug_queued_count(q);
rq = blk_mq_map_request(q, bio, &data);
- if (unlikely(!rq))
+ if (unlikely(!rq)) {
+ bio_io_error(bio);
return BLK_QC_T_NONE;
+ }
cookie = blk_tag_to_qc_t(rq->tag, data.hctx->queue_num);
--
2.10.2
next reply other threads:[~2017-02-13 16:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 16:04 Goldwyn Rodrigues [this message]
2017-02-13 16:07 ` [PATCH] blk-mq: Call bio_io_error if request returned is NULL Jens Axboe
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=20170213160454.30869-1-rgoldwyn@suse.de \
--to=rgoldwyn@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=rgoldwyn@suse.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