Re: [PATCH 1/1] percpu-refcount: fix reference leak during percpu-atomic transition

2017-01-27 Thread Douglas Miller
I'd like to request this be flagged for "stable". Thanks, Doug On 01/27/2017 02:59 PM, Douglas Miller wrote: percpu_ref_tryget() and percpu_ref_tryget_live() should return "true" IFF they acquire a reference. But the return value from atomic_long_inc_not_zero() is a long and may have high bi

Re: [PATCH 1/1] percpu-refcount: fix reference leak during percpu-atomic transition

2017-01-27 Thread Jens Axboe
On 01/27/2017 01:59 PM, Douglas Miller wrote: > percpu_ref_tryget() and percpu_ref_tryget_live() should return > "true" IFF they acquire a reference. But the return value from > atomic_long_inc_not_zero() is a long and may have high bits set, > e.g. PERCPU_COUNT_BIAS, and the return value of the tr

Re: [PATCH 1/1] percpu-refcount: fix reference leak during percpu-atomic transition

2017-01-27 Thread Tejun Heo
Hello, Douglas. On Fri, Jan 27, 2017 at 02:59:08PM -0600, Douglas Miller wrote: > @@ -212,7 +212,7 @@ static inline bool percpu_ref_tryget(struct percpu_ref > *ref) > this_cpu_inc(*percpu_count); > ret = true; > } else { > - ret = atomic_long_inc_not_

[PATCH 1/1] percpu-refcount: fix reference leak during percpu-atomic transition

2017-01-27 Thread Douglas Miller
percpu_ref_tryget() and percpu_ref_tryget_live() should return "true" IFF they acquire a reference. But the return value from atomic_long_inc_not_zero() is a long and may have high bits set, e.g. PERCPU_COUNT_BIAS, and the return value of the tryget routines is bool so the reference may actually be