diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2010-03-02 04:54:50 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-01 19:01:16 -0400 |
commit | fe030f50c598ffd9476da37d35a7dd7301487795 (patch) | |
tree | 728d2b4462739ee00803f2865bffe2654a1890a3 /kernel/trace | |
parent | a86a83770fe3cc858f91b0ae6406477dc8d0bf17 (diff) |
tracing: Fix warning in s_next of trace file ops
commit ac91d85456372a90af5b85eb6620fd2efb1e431b upstream.
This warning in s_next() can be triggered by lseek():
[<c018b3f7>] ? s_next+0x77/0x80
[<c013e3c1>] warn_slowpath_common+0x81/0xa0
[<c018b3f7>] ? s_next+0x77/0x80
[<c013e3fa>] warn_slowpath_null+0x1a/0x20
[<c018b3f7>] s_next+0x77/0x80
[<c01efa77>] traverse+0x117/0x200
[<c01eff13>] seq_lseek+0xa3/0x120
[<c01efe70>] ? seq_lseek+0x0/0x120
[<c01d7081>] vfs_llseek+0x41/0x50
[<c01d8116>] sys_llseek+0x66/0xa0
[<c0102bd0>] sysenter_do_call+0x12/0x26
The iterator "leftover" variable is zeroed in the opening of the trace
file. But lseek can call s_start() which will call s_next() without
reseting the "leftover" variable back to zero, which might trigger
the WARN_ON_ONCE(iter->leftover) that is in s_next().
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
LKML-Reference: <4B8CE06A.9090207@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index eac6875cb990..1069dcb935e3 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1628,6 +1628,7 @@ static void *s_start(struct seq_file *m, loff_t *pos) | |||
1628 | 1628 | ||
1629 | ftrace_enable_cpu(); | 1629 | ftrace_enable_cpu(); |
1630 | 1630 | ||
1631 | iter->leftover = 0; | ||
1631 | for (p = iter; p && l < *pos; p = s_next(m, p, &l)) | 1632 | for (p = iter; p && l < *pos; p = s_next(m, p, &l)) |
1632 | ; | 1633 | ; |
1633 | 1634 | ||