Skip to content
Commit 6cf93730 authored by Khazhismel Kumykov's avatar Khazhismel Kumykov Committed by Greg Kroah-Hartman
Browse files

blk-throttle: check for overflow in calculate_bytes_allowed

commit 2dd710d4 upstream.

Inexact, we may reject some not-overflowing values incorrectly, but
they'll be on the order of exabytes allowed anyways.

This fixes divide error crash on x86 if bps_limit is not configured or
is set too high in the rare case that jiffy_elapsed is greater than HZ.

Fixes: e8368b57 ("blk-throttle: use calculate_io/bytes_allowed() for throtl_trim_slice()")
Fixes: 8d6bbaad

 ("blk-throttle: prevent overflow while calculating wait time")
Signed-off-by: default avatarKhazhismel Kumykov <khazhy@google.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20231020223617.2739774-1-khazhy@google.com
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c031d9a8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment