lkml.org 
[lkml]   [2020]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/7] t_next should increase position index
Date
if seq_file .next fuction does not change position index,
read after some lseek can generate unexpected output.

https://bugzilla.kernel.org/show_bug.cgi?id=206283
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
kernel/trace/ftrace.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 9bf1f2c..ca25210 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3442,8 +3442,10 @@ static void *t_mod_start(struct seq_file *m, loff_t *pos)
loff_t l = *pos; /* t_probe_start() must use original pos */
void *ret;

- if (unlikely(ftrace_disabled))
+ if (unlikely(ftrace_disabled)) {
+ (*pos)++;
return NULL;
+ }

if (iter->flags & FTRACE_ITER_PROBE)
return t_probe_next(m, pos);
--
1.8.3.1
\
 
 \ /
  Last update: 2020-01-24 08:04    [W:0.030 / U:1.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site