Skip to content

Commit 81ea122

Browse files
Ming Leiaxboe
authored andcommitted
Revert "block: Merge bio before checking ->cached_rq"
This reverts commit 23f3e32. blk-mq sched bio merge still needs request to grab queue usage counter, so we can't simply call blk_mq_attempt_bio_merge() when queue usage counter isn't held. Fixes: 23f3e32 ("block: Merge bio before checking ->cached_rq") Cc: Xiao Ni <[email protected]> Reported-by: Yi Zhang <[email protected]> Signed-off-by: Ming Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent f7ca1ae commit 81ea122

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

block/blk-mq.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,16 +2878,15 @@ static inline struct request *blk_mq_get_cached_request(struct request_queue *q,
28782878

28792879
if (!plug)
28802880
return NULL;
2881+
rq = rq_list_peek(&plug->cached_rq);
2882+
if (!rq || rq->q != q)
2883+
return NULL;
28812884

28822885
if (blk_mq_attempt_bio_merge(q, *bio, nsegs)) {
28832886
*bio = NULL;
28842887
return NULL;
28852888
}
28862889

2887-
rq = rq_list_peek(&plug->cached_rq);
2888-
if (!rq || rq->q != q)
2889-
return NULL;
2890-
28912890
type = blk_mq_get_hctx_type((*bio)->bi_opf);
28922891
hctx_type = rq->mq_hctx->type;
28932892
if (type != hctx_type &&

0 commit comments

Comments
 (0)