OSDN Git Service

jbd2_seq_info_next should increase position index
authorVasily Averin <vvs@virtuozzo.com>
Thu, 23 Jan 2020 09:05:10 +0000 (12:05 +0300)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 25 Jan 2020 07:30:46 +0000 (02:30 -0500)
commit1a8e9cf40c9a6a2e40b1e924b13ed303aeea4418
treed62a68e60c0387ac45c79584ca8ec256e764123c
parent17c51d836c19ecc58714fc671a914a47b6ae4db7
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: 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code and interface")
Cc: stable@kernel.org
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/d13805e5-695e-8ac3-b678-26ca2313629f@virtuozzo.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/journal.c