Messages in this thread | | | From | Qian Cai <> | Subject | Re: [PATCH] mm/page-writeback.c: avoid potential division by zero | Date | Wed, 1 Jan 2020 07:39:48 -0500 |
| |
> On Jan 1, 2020, at 4:32 AM, Wen Yang <wenyang@linux.alibaba.com> wrote: > > The variables 'min', 'max' and 'bw' are unsigned long and > do_div truncates them to 32 bits, which means it can test > non-zero and be truncated to zero for division. > Fix this issue by using div64_ul() instead.
How did you find out the issue? If it is caught by compilers, can you paste the original warnings? Also, can you figure out which commit introduced the issue in the first place, so it could be backported to stable if needed?
> > For the two variables 'numerator' and 'denominator', > though they are declared as long, they should actually be > unsigned long (according to the implementation of > the fprop_fraction_percpu() function).
| |