Commit 7c792f33 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: initialize current->bio_list[1] in __submit_bio_noacct_mq

bio_alloc_bioset references current->bio_list[1], so we need to
initialize it for the blk-mq submission path as well.

Fixes: ff93ea0c ("block: shortcut __submit_bio_noacct for blk-mq drivers")
Reported-by: default avatarQian Cai <cai@lca.pw>
Reported-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 4e2f62e5
...@@ -1155,11 +1155,10 @@ static blk_qc_t __submit_bio_noacct(struct bio *bio) ...@@ -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) static blk_qc_t __submit_bio_noacct_mq(struct bio *bio)
{ {
struct gendisk *disk = bio->bi_disk; 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; blk_qc_t ret = BLK_QC_T_NONE;
bio_list_init(&bio_list); current->bio_list = bio_list;
current->bio_list = &bio_list;
do { do {
WARN_ON_ONCE(bio->bi_disk != disk); WARN_ON_ONCE(bio->bi_disk != disk);
...@@ -1174,7 +1173,7 @@ static blk_qc_t __submit_bio_noacct_mq(struct bio *bio) ...@@ -1174,7 +1173,7 @@ static blk_qc_t __submit_bio_noacct_mq(struct bio *bio)
} }
ret = blk_mq_submit_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; current->bio_list = NULL;
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment