summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-08-16 11:17:30 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-08-16 11:17:30 -0400
commitd244b6bd41e09ecbb09c738cc2c108be227398c8 (patch)
tree848c6a8a0d6f83929daf43d63e241dc8072066ac /kernel/trace/trace.c
parentda5cabf80e2433131bf0ed8993abc0f7ea618c73 (diff)
parent1aa54bca6ee0d07ebcafb8ca8074b624d80724aa (diff)
downloadop-kernel-dev-d244b6bd41e09ecbb09c738cc2c108be227398c8.zip
op-kernel-dev-d244b6bd41e09ecbb09c738cc2c108be227398c8.tar.gz
Merge branch 'tip/perf/urgent-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into trace/tip/perf/urgent-4
Conflicts: kernel/trace/trace_events.c Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index ba14a22..9ec59f5 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3463,6 +3463,7 @@ tracing_mark_write(struct file *filp, const char __user *ubuf,
size_t cnt, loff_t *fpos)
{
char *buf;
+ size_t written;
if (tracing_disabled)
return -EINVAL;
@@ -3484,11 +3485,15 @@ tracing_mark_write(struct file *filp, const char __user *ubuf,
} else
buf[cnt] = '\0';
- cnt = mark_printk("%s", buf);
+ written = mark_printk("%s", buf);
kfree(buf);
- *fpos += cnt;
+ *fpos += written;
- return cnt;
+ /* don't tell userspace we wrote more - it might confuse them */
+ if (written > cnt)
+ written = cnt;
+
+ return written;
}
static int tracing_clock_show(struct seq_file *m, void *v)
OpenPOWER on IntegriCloud