Re: [PATCH block/for-next] blk-iocost: fix divide-by-zero in transfer_surpluses()

From: Jens Axboe
Date: Fri Sep 11 2020 - 13:12:12 EST


On 9/11/20 11:07 AM, Tejun Heo wrote:
> 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.

Applied, thanks.

--
Jens Axboe