diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2021-08-11 12:36:57 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-18 13:40:08 +0200 |
commit | 0d54bbad80f7294e6e2cb335a9861899512b2a77 (patch) | |
tree | 6520416c09e55c4954a6f580ecebbba3adf84073 /block | |
parent | 5df14bba0056fb7d075dd6dc8c26ff3da33e4fc1 (diff) | |
download | linux-stable-0d54bbad80f7294e6e2cb335a9861899512b2a77.tar.gz linux-stable-0d54bbad80f7294e6e2cb335a9861899512b2a77.tar.bz2 linux-stable-0d54bbad80f7294e6e2cb335a9861899512b2a77.zip |
block: bfq: fix bfq_set_next_ioprio_data()
commit a680dd72ec336b81511e3bff48efac6dbfa563e7 upstream.
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: aee69d78dec0 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block')
-rw-r--r-- | block/bfq-iosched.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 8ea37328ca84..b8c2ddc01aec 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5011,7 +5011,7 @@ bfq_set_next_ioprio_data(struct bfq_queue *bfqq, struct bfq_io_cq *bic) if (bfqq->new_ioprio >= IOPRIO_BE_NR) { pr_crit("bfq_set_next_ioprio_data: new_ioprio %d\n", bfqq->new_ioprio); - bfqq->new_ioprio = IOPRIO_BE_NR; + bfqq->new_ioprio = IOPRIO_BE_NR - 1; } bfqq->entity.new_weight = bfq_ioprio_to_weight(bfqq->new_ioprio); |