Skip to content

Commit e8330cb

Browse files
osandovgregkh
authored andcommitted
blk-mq: really fix plug list flushing for nomerge queues
commit 87c279e613f848c691111b29d49de8df3f4f56da upstream. Commit 0809e3a ("block: fix plug list flushing for nomerge queues") updated blk_mq_make_request() to set request_count even when blk_queue_nomerges() returns true. However, blk_mq_make_request() only does limited plugging and doesn't use request_count; blk_sq_make_request() is the one that should have been fixed. Do that and get rid of the unnecessary work in the mq version. Fixes: 0809e3a ("block: fix plug list flushing for nomerge queues") Signed-off-by: Omar Sandoval <osandov@fb.com> Reviewed-by: Ming Lei <tom.leiming@gmail.com> Reviewed-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f0414c1 commit e8330cb

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

block/blk-mq.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,12 +1259,9 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
12591259

12601260
blk_queue_split(q, &bio, q->bio_split);
12611261

1262-
if (!is_flush_fua && !blk_queue_nomerges(q)) {
1263-
if (blk_attempt_plug_merge(q, bio, &request_count,
1264-
&same_queue_rq))
1265-
return BLK_QC_T_NONE;
1266-
} else
1267-
request_count = blk_plug_queued_count(q);
1262+
if (!is_flush_fua && !blk_queue_nomerges(q) &&
1263+
blk_attempt_plug_merge(q, bio, &request_count, &same_queue_rq))
1264+
return BLK_QC_T_NONE;
12681265

12691266
rq = blk_mq_map_request(q, bio, &data);
12701267
if (unlikely(!rq))
@@ -1355,9 +1352,11 @@ static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio)
13551352

13561353
blk_queue_split(q, &bio, q->bio_split);
13571354

1358-
if (!is_flush_fua && !blk_queue_nomerges(q) &&
1359-
blk_attempt_plug_merge(q, bio, &request_count, NULL))
1360-
return BLK_QC_T_NONE;
1355+
if (!is_flush_fua && !blk_queue_nomerges(q)) {
1356+
if (blk_attempt_plug_merge(q, bio, &request_count, NULL))
1357+
return BLK_QC_T_NONE;
1358+
} else
1359+
request_count = blk_plug_queued_count(q);
13611360

13621361
rq = blk_mq_map_request(q, bio, &data);
13631362
if (unlikely(!rq))

0 commit comments

Comments
 (0)