* [PATCH] block: initialize current->bio_list[1] in __submit_bio_noacct_mq
@ 2020-07-02 19:21 Christoph Hellwig
2020-07-02 19:35 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2020-07-02 19:21 UTC (permalink / raw)
To: axboe; +Cc: linux-block, Qian Cai, Naresh Kamboju
bio_alloc_bioset references current->bio_list[1], so we need to
initialize it for the blk-mq submission path as well.
Fixes: ff93ea0ce763 ("block: shortcut __submit_bio_noacct for blk-mq drivers")
Reported-by: Qian Cai <cai@lca.pw>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>
---
block/blk-core.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index bf882b8d84450c..9f1bf8658b611a 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1155,11 +1155,10 @@ static blk_qc_t __submit_bio_noacct(struct bio *bio)
static blk_qc_t __submit_bio_noacct_mq(struct bio *bio)
{
struct gendisk *disk = bio->bi_disk;
- struct bio_list bio_list;
+ struct bio_list bio_list[2] = { };
blk_qc_t ret = BLK_QC_T_NONE;
- bio_list_init(&bio_list);
- current->bio_list = &bio_list;
+ current->bio_list = bio_list;
do {
WARN_ON_ONCE(bio->bi_disk != disk);
@@ -1174,7 +1173,7 @@ static blk_qc_t __submit_bio_noacct_mq(struct bio *bio)
}
ret = blk_mq_submit_bio(bio);
- } while ((bio = bio_list_pop(&bio_list)));
+ } while ((bio = bio_list_pop(&bio_list[0])));
current->bio_list = NULL;
return ret;
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] block: initialize current->bio_list[1] in __submit_bio_noacct_mq
2020-07-02 19:21 [PATCH] block: initialize current->bio_list[1] in __submit_bio_noacct_mq Christoph Hellwig
@ 2020-07-02 19:35 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2020-07-02 19:35 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-block, Qian Cai, Naresh Kamboju
On 7/2/20 1:21 PM, Christoph Hellwig wrote:
> bio_alloc_bioset references current->bio_list[1], so we need to
> initialize it for the blk-mq submission path as well.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-02 19:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02 19:21 [PATCH] block: initialize current->bio_list[1] in __submit_bio_noacct_mq Christoph Hellwig
2020-07-02 19:35 ` Jens Axboe
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).