tracing: Change tracing_stats_fops to rely on tracing_get_cpu()
authorOleg Nesterov <oleg@redhat.com>
Tue, 23 Jul 2013 15:26:03 +0000 (17:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2013 16:47:32 +0000 (09:47 -0700)
commit6dafb0f13798c998ec344bf910b2d89c51961481
tree81b45e5ef0f224801d09f6453199d39b4c6b7412
parent92b6279e284257fb7908bf4d24956f5af13aaa2d
tracing: Change tracing_stats_fops to rely on tracing_get_cpu()

commit 4d3435b8a4c3357695e09c5e7a3bf73a19fca5b0 upstream.

tracing_open_generic_tc() is racy, the memory inode->i_private
points to can be already freed.

1. Change one of its users, tracing_stats_fops, to use
   tracing_*_generic_tr() instead.

2. Change trace_create_cpu_file("stats", data) to pass "data = tr".

3. Change tracing_stats_read() to use tracing_get_cpu().

Link: http://lkml.kernel.org/r/20130723152603.GA23727@redhat.com

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace.c