help_next should increase position index
authorVasily Averin <vvs@virtuozzo.com>
Fri, 24 Jan 2020 06:10:47 +0000 (09:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Feb 2020 15:36:08 +0000 (16:36 +0100)
[ Upstream commit 9f198a2ac543eaaf47be275531ad5cbd50db3edf ]

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>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/orangefs/orangefs-debugfs.c

index 1c59dff530dee5d10eadcb671798367ee40e173b..34d1cc98260d23dd8d3df5d9f87613be06766c7c 100644 (file)
@@ -305,6 +305,7 @@ static void *help_start(struct seq_file *m, loff_t *pos)
 
 static void *help_next(struct seq_file *m, void *v, loff_t *pos)
 {
+       (*pos)++;
        gossip_debug(GOSSIP_DEBUGFS_DEBUG, "help_next: start\n");
 
        return NULL;