Skip to content

Commit 1a8e9cf

Browse files
vaverintytso
authored andcommitted
jbd2_seq_info_next should increase position index
if seq_file .next fuction does not change position index, read after some lseek can generate unexpected output. Script below generates endless output $ q=;while read -r r;do echo "$((++q)) $r";done </proc/fs/jbd2/DEV/info https://bugzilla.kernel.org/show_bug.cgi?id=206283 Fixes: 1f4aace ("fs/seq_file.c: simplify seq_file iteration code and interface") Cc: [email protected] Signed-off-by: Vasily Averin <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 17c51d8 commit 1a8e9cf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/jbd2/journal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ static void *jbd2_seq_info_start(struct seq_file *seq, loff_t *pos)
982982

983983
static void *jbd2_seq_info_next(struct seq_file *seq, void *v, loff_t *pos)
984984
{
985+
(*pos)++;
985986
return NULL;
986987
}
987988

0 commit comments

Comments
 (0)