[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM_iQpVsAhsG_SLDSgTkZ0RjvCzhu2d5Nt5SQ=NoVa0UYYMoug@mail.gmail.com>
Date: Tue, 20 Apr 2021 12:53:00 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: linux-block@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>,
Cong Wang <cong.wang@...edance.com>,
Jens Axboe <axboe@...nel.dk>,
Fam Zheng <fam.zheng@...edance.com>,
Xiongchun Duan <duanxiongchun@...edance.com>
Subject: Re: [Patch] blk-wbt: fix a divide-by-zero error in rwb_arm_timer()
On Sat, Apr 17, 2021 at 9:41 PM Cong Wang <xiyou.wangcong@...il.com> wrote:
>
> From: Cong Wang <cong.wang@...edance.com>
>
> We hit a divide error in rwb_arm_timer() and crash dump shows
> rqd->scale_step is 16777215 (0xffffff in hex), so the expression
> "(rqd->scale_step + 1) << 8)" is 0x100000000, which is just beyond
> 32-bit integer range, hence it is truncated to 0 and int_sqrt(0)
> returns 0 too, so we end up passing 0 as a divisor to div_u64().
>
Never mind. rqd->scale_step should be capped by
rq_depth_scale_down(), so should never be so large. In the old
calc_wb_limits() implementation, rwb->wb_max was set to zero
accidentally.
Thanks.
Powered by blists - more mailing lists