Skip to content

Commit f673b4f

Browse files
bvanasscheaxboe
authored andcommitted
block/mq-deadline: Fix a bug in deadline_from_pos()
A bug was introduced in deadline_from_pos() while implementing the suggestion to use round_down() in the following code: pos -= bdev_offset_from_zone_start(rq->q->disk->part0, pos); This patch makes deadline_from_pos() use round_down() such that 'pos' is rounded down. Reported-by: Shin'ichiro Kawasaki <[email protected]> Closes: https://lore.kernel.org/all/5zthzi3lppvcdp4nemum6qck4gpqbdhvgy4k3qwguhgzxc4quj@amulvgycq67h/ Cc: Christoph Hellwig <[email protected]> Cc: Damien Le Moal <[email protected]> Fixes: 0effb39 ("block: mq-deadline: Handle requeued requests correctly") Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent dc8cbb6 commit f673b4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/mq-deadline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static inline struct request *deadline_from_pos(struct dd_per_prio *per_prio,
176176
* zoned writes, start searching from the start of a zone.
177177
*/
178178
if (blk_rq_is_seq_zoned_write(rq))
179-
pos -= round_down(pos, rq->q->limits.chunk_sectors);
179+
pos = round_down(pos, rq->q->limits.chunk_sectors);
180180

181181
while (node) {
182182
rq = rb_entry_rq(node);

0 commit comments

Comments
 (0)