Re: [PATCH 2/7] gcov_seq_next should increase position index
From: Peter Oberparleiter
Date: Thu Jan 30 2020 - 08:09:48 EST
On 24.01.2020 08:02, Vasily Averin wrote:
> 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@xxxxxxxxxxxxx>
Acked-by: Peter Oberparleiter <oberpar@xxxxxxxxxxxxx>
> ---
> kernel/gcov/fs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c
> index e5eb5ea..cc4ee48 100644
> --- a/kernel/gcov/fs.c
> +++ b/kernel/gcov/fs.c
> @@ -108,9 +108,9 @@ static void *gcov_seq_next(struct seq_file *seq, void *data, loff_t *pos)
> {
> struct gcov_iterator *iter = data;
>
> + (*pos)++;
> if (gcov_iter_next(iter))
> return NULL;
> - (*pos)++;
>
> return iter;
> }
>
--
Peter Oberparleiter
Linux on Z Development - IBM Germany