Skip to contentSkip to conversation

trigger_next should increase position index

PATCH Superseded Vasily Averin 1 participant 1 message Jan 24, 2020 Tracing

v1 of 3 Superseded 3 of 7 applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 6/7 trigger_next should increase position index

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

---
 kernel/trace/trace_events_trigger.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/trace/trace_events_trigger.c +3 -2
index 2cd53ca..d5f5e5c 100644
@@ -116,9 +116,10 @@ static void *trigger_next(struct seq_file *m, void *t, loff_t *pos)
 {
 	struct trace_event_file *event_file = event_file_data(m->private);
 
-	if (t == SHOW_AVAILABLE_TRIGGERS)
+	if (t == SHOW_AVAILABLE_TRIGGERS) {
+		(*pos)++;
 		return NULL;
-
+	}
 	return seq_list_next(t, &event_file->triggers, pos);
 }
 
Signature · 1 line
1.8.3.1