commit | 769b628de0b9a7ab0b81e6eecca5ee7bf66e978d | [log] [tgz] |
---|---|---|
author | Tejun Heo <tj@kernel.org> | Fri Sep 11 18:40:49 2020 -0400 |
committer | Jens Axboe <axboe@kernel.dk> | Fri Sep 11 16:41:47 2020 -0600 |
tree | 39ebaa9dc4a2a062fe38ea3aebfdce8d1c642cc9 | |
parent | 0806e60f31ec10822cd230d12603169d1bb7840e [diff] |
blk-iocost: fix divide-by-zero in transfer_surpluses() Conceptually, root_iocg->hweight_donating must be less than WEIGHT_ONE but all hweight calculations round up and thus it may end up >= WEIGHT_ONE triggering divide-by-zero and other issues. Bound the value to avoid surprises. Fixes: e08d02aa5fc9 ("blk-iocost: implement Andy's method for donation weight updates") Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>