mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Vasily Averin <vvs@virtuozzo.com>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	NeilBrown <neilb@suse.com>, Waiman Long <longman@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>
Subject: Re: [PATCH 3/7] t_next should increase position index
Date: Wed, 29 Jan 2020 12:12:57 -0500	[thread overview]
Message-ID: <20200129121257.3cf9c2d6@gandalf.local.home> (raw)
In-Reply-To: <8681248a-da16-5448-31fe-26df9e7cfc25@virtuozzo.com>

On Fri, 24 Jan 2020 10:02:51 +0300
Vasily Averin <vvs@virtuozzo.com> 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@virtuozzo.com>
> ---
>  kernel/trace/ftrace.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 9bf1f2c..ca25210 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -3442,8 +3442,10 @@ static void *t_mod_start(struct seq_file *m, loff_t *pos)
>  	loff_t l = *pos; /* t_probe_start() must use original pos */
>  	void *ret;
>  
> -	if (unlikely(ftrace_disabled))
> +	if (unlikely(ftrace_disabled)) {
> +		(*pos)++;
>  		return NULL;
> +	}

This isn't needed. If ftrace_disabled is set, we shouldn't be printing
anything. This case isn't the same as the report in the bugzilla.

-- Steve

>  
>  	if (iter->flags & FTRACE_ITER_PROBE)
>  		return t_probe_next(m, pos);


  reply	other threads:[~2020-01-29 17:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24  7:02 Vasily Averin
2020-01-29 17:12 ` Steven Rostedt [this message]
2020-01-30  7:17   ` Vasily Averin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200129121257.3cf9c2d6@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=neilb@suse.com \
    --cc=oberpar@linux.ibm.com \
    --cc=vvs@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®