summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-03-05 02:31:11 +0100
committerSteven Rostedt <srostedt@redhat.com>2009-03-05 02:31:11 +0100
commite74da5235cec6cb71eb338c987f876ecc793138b (patch)
treeba7ba533d7056ba660763c33b5a44a1d61279c99 /kernel
parenttracing: do not return EFAULT if read copied anything (diff)
downloadlinux-e74da5235cec6cb71eb338c987f876ecc793138b.tar.xz
linux-e74da5235cec6cb71eb338c987f876ecc793138b.zip
tracing: fix seq read from trace files
The buffer used by trace_seq was updated incorrectly. Instead of consuming what was actually read, it consumed the rest of the buffer on reads. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 57155dc53530..2e53e6f09440 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -361,7 +361,7 @@ ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, size_t cnt)
cnt -= ret;
- s->readpos += len;
+ s->readpos += cnt;
return cnt;
}
@@ -380,7 +380,7 @@ ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt)
if (!ret)
return -EFAULT;
- s->readpos += len;
+ s->readpos += cnt;
return cnt;
}