Skip to content

Commit 7c792f3

Browse files
Christoph Hellwigaxboe
authored andcommitted
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: ff93ea0 ("block: shortcut __submit_bio_noacct for blk-mq drivers") Reported-by: Qian Cai <[email protected]> Reported-by: Naresh Kamboju <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Tested-by: Naresh Kamboju <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 4e2f62e commit 7c792f3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

block/blk-core.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,11 +1155,10 @@ static blk_qc_t __submit_bio_noacct(struct bio *bio)
11551155
static blk_qc_t __submit_bio_noacct_mq(struct bio *bio)
11561156
{
11571157
struct gendisk *disk = bio->bi_disk;
1158-
struct bio_list bio_list;
1158+
struct bio_list bio_list[2] = { };
11591159
blk_qc_t ret = BLK_QC_T_NONE;
11601160

1161-
bio_list_init(&bio_list);
1162-
current->bio_list = &bio_list;
1161+
current->bio_list = bio_list;
11631162

11641163
do {
11651164
WARN_ON_ONCE(bio->bi_disk != disk);
@@ -1174,7 +1173,7 @@ static blk_qc_t __submit_bio_noacct_mq(struct bio *bio)
11741173
}
11751174

11761175
ret = blk_mq_submit_bio(bio);
1177-
} while ((bio = bio_list_pop(&bio_list)));
1176+
} while ((bio = bio_list_pop(&bio_list[0])));
11781177

11791178
current->bio_list = NULL;
11801179
return ret;

0 commit comments

Comments
 (0)