Commit ed9f7876 authored by Yu Kuai's avatar Yu Kuai Committed by Yang Yingliang
Browse files

blk-mq: fix divide by zero crash in tg_may_dispatch()

hulk inclusion
category: bugfix
bugzilla: 177149, https://gitee.com/openeuler/kernel/issues/I47R8R


CVE: NA

-----------------------------------------------

If blk-throttle is enabled and io is issued before
blk_throtl_register_queue() is done. Divide by zero crash will be
triggered in tg_may_dispatch() because 'throtl_slice' is uninitialized.

Thus introduce a new falg QUEUE_FLAG_THROTL_INIT_DONE. It will be set
after blk_throtl_register_queue() is done, and will be checked before
apply any config.

Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent d406b81b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment