Skip to content

Commit

Permalink
block: initialize current->bio_list[1] in __submit_bio_noacct_mq
Browse files Browse the repository at this point in the history
bio_alloc_bioset references current->bio_list[1], so we need to
initialize it for the blk-mq submission path as well.

Fixes: ff93ea0 ("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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Jul 2, 2020
1 parent 4e2f62e commit 7c792f3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 7c792f3

Please sign in to comment.