]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
ftrace: fix current_tracer error return
authorSteven Rostedt <rostedt@goodmis.org>
Tue, 28 Oct 2008 14:44:24 +0000 (10:44 -0400)
committerIngo Molnar <mingo@elte.hu>
Tue, 28 Oct 2008 15:33:47 +0000 (16:33 +0100)
commit60063a66236c15f5613f91390631e06718689782
tree3625c15ade69e4f8cbb85d737290da1312123241
parent21798a84ab383cdac0e7ee3368e0792b718b867d
ftrace: fix current_tracer error return

The commit (in linux-tip) c2931e05ec5965597cbfb79ad332d4a29aeceb23
 ( ftrace: return an error when setting a nonexistent tracer )
added useful code that would error when a bad tracer was written into
the current_tracer file.

But this had a bug if the amount written was more than the amount read by
that code. The first iteration would set the tracer correctly, but since
it did not consume the rest of what was written (usually whitespace), the
userspace utility would continue to write what was not consumed. This
second iteration would fail to find a tracer and return -EINVAL. Funny
thing is that the tracer would have already been set.

This patch just consumes all the data that is written to the file.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/trace.c