Re: [PATCH] core: fix the use of this_cpu_ptr
From: Eric Dumazet <hidden>
Date: 2013-03-28 13:05:36
On Thu, 2013-03-28 at 17:42 +0800, roy.qing.li@gmail.com wrote:
quoted hunk ↗ jump to hunk
From: Li RongQing <redacted> flush_tasklet is not percpu var, and percpu is percpu var, and this_cpu_ptr(&info->cache->percpu->flush_tasklet) is not equal to &this_cpu_ptr(info->cache->percpu)->flush_tasklet 1f743b076(use this_cpu_ptr per-cpu helper) introduced this bug. Signed-off-by: Li RongQing <redacted> --- net/core/flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/net/core/flow.c b/net/core/flow.c index 7fae135..e8084b8 100644 --- a/net/core/flow.c +++ b/net/core/flow.c@@ -346,7 +346,7 @@ static void flow_cache_flush_per_cpu(void *data) struct flow_flush_info *info = data; struct tasklet_struct *tasklet; - tasklet = this_cpu_ptr(&info->cache->percpu->flush_tasklet); + tasklet = &this_cpu_ptr(info->cache->percpu)->flush_tasklet; tasklet->data = (unsigned long)info; tasklet_schedule(tasklet); }
Hi Any reason you dont Cc Shan Wei & Christoph Lameter ? Christoph, could this kind of error be detected by the compiler or sparse ? Thanks