Skip to content

Commit a680dd7

Browse files
damien-lemoalaxboe
authored andcommitted
block: bfq: fix bfq_set_next_ioprio_data()
For a request that has a priority level equal to or larger than IOPRIO_BE_NR, bfq_set_next_ioprio_data() prints a critical warning but defaults to setting the request new_ioprio field to IOPRIO_BE_NR. This is not consistent with the warning and the allowed values for priority levels. Fix this by setting the request new_ioprio field to IOPRIO_BE_NR - 1, the lowest priority level allowed. Cc: <stable@vger.kernel.org> Fixes: aee69d7 ("block, bfq: introduce the BFQ-v0 I/O scheduler as an extra scheduler") Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20210811033702.368488-2-damien.lemoal@wdc.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 69f87cc commit a680dd7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎block/bfq-iosched.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5296,7 +5296,7 @@ bfq_set_next_ioprio_data(struct bfq_queue *bfqq, struct bfq_io_cq *bic)
52965296
if (bfqq->new_ioprio >= IOPRIO_BE_NR) {
52975297
pr_crit("bfq_set_next_ioprio_data: new_ioprio %d\n",
52985298
bfqq->new_ioprio);
5299-
bfqq->new_ioprio = IOPRIO_BE_NR;
5299+
bfqq->new_ioprio = IOPRIO_BE_NR - 1;
53005300
}
53015301

53025302
bfqq->entity.new_weight = bfq_ioprio_to_weight(bfqq->new_ioprio);

0 commit comments

Comments
 (0)