Re: [PATCH] percpu_counter: `percpu_counter_read_positive' should not return negative number

2018-06-07 Thread Mathieu Malaterre
On Wed, Jun 6, 2018 at 9:57 PM Tejun Heo wrote: > > On Wed, Jun 06, 2018 at 09:39:40PM +0200, Mathieu Malaterre wrote: > > Since function `percpu_counter_add' may result in a signed integer overflow > > the result stored in `fbc->count' could be negative. Make sure that > > function

Re: [PATCH] percpu_counter: `percpu_counter_read_positive' should not return negative number

2018-06-07 Thread Mathieu Malaterre
On Wed, Jun 6, 2018 at 9:57 PM Tejun Heo wrote: > > On Wed, Jun 06, 2018 at 09:39:40PM +0200, Mathieu Malaterre wrote: > > Since function `percpu_counter_add' may result in a signed integer overflow > > the result stored in `fbc->count' could be negative. Make sure that > > function

Re: [PATCH] percpu_counter: `percpu_counter_read_positive' should not return negative number

2018-06-06 Thread Tejun Heo
On Wed, Jun 06, 2018 at 09:39:40PM +0200, Mathieu Malaterre wrote: > Since function `percpu_counter_add' may result in a signed integer overflow > the result stored in `fbc->count' could be negative. Make sure that > function `percpu_counter_read_positive' does not return a negative number > in

Re: [PATCH] percpu_counter: `percpu_counter_read_positive' should not return negative number

2018-06-06 Thread Tejun Heo
On Wed, Jun 06, 2018 at 09:39:40PM +0200, Mathieu Malaterre wrote: > Since function `percpu_counter_add' may result in a signed integer overflow > the result stored in `fbc->count' could be negative. Make sure that > function `percpu_counter_read_positive' does not return a negative number > in

[PATCH] percpu_counter: `percpu_counter_read_positive' should not return negative number

2018-06-06 Thread Mathieu Malaterre
Since function `percpu_counter_add' may result in a signed integer overflow the result stored in `fbc->count' could be negative. Make sure that function `percpu_counter_read_positive' does not return a negative number in this case. This will match behavior when CONFIG_SMP=y. Detected wth

[PATCH] percpu_counter: `percpu_counter_read_positive' should not return negative number

2018-06-06 Thread Mathieu Malaterre
Since function `percpu_counter_add' may result in a signed integer overflow the result stored in `fbc->count' could be negative. Make sure that function `percpu_counter_read_positive' does not return a negative number in this case. This will match behavior when CONFIG_SMP=y. Detected wth