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

commit 0bc392ee46d0fd8e6b678457ef71f074f19a03c5 upstream.

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

1. Change its last user, tracing_entries_fops, to use
   tracing_*_generic_tr() instead.

2. Change debugfs_create_file("buffer_size_kb", data) callers
   to pass "data = tr".

3. Change tracing_entries_read() and tracing_entries_write() to
   use tracing_get_cpu().

4. Kill the no longer used tracing_open_generic_tc() and
   tracing_release_generic_tc().

Link: http://lkml.kernel.org/r/20130723152606.GA23730@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