lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201006103638.153e39d3@gandalf.local.home>
Date:   Tue, 6 Oct 2020 10:36:38 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Wei Yang <richard.weiyang@...ux.alibaba.com>
Cc:     mingo@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/6] ftrace: define seq_file only for FMODE_READ

On Mon, 31 Aug 2020 11:10:59 +0800
Wei Yang <richard.weiyang@...ux.alibaba.com> wrote:

> The purpose of the operation is to get ftrace_iterator, which is embedded
> in file or seq_file for FMODE_WRITE/FMODE_READ respectively. Since we
> don't have a seq_file for FMODE_WRITE case, it is meaningless to cast
> file->private_data to seq_file.
> 
> Let's move the definition when there is a valid seq_file.

I didn't pull in this patch because I find the original more expressive,
and there's really no benefit in changing it.

-- Steve


> 
> Signed-off-by: Wei Yang <richard.weiyang@...ux.alibaba.com>
> ---
>  kernel/trace/ftrace.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index edc233122598..12cb535769bc 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -5558,7 +5558,6 @@ static void __init set_ftrace_early_filters(void)
>  
>  int ftrace_regex_release(struct inode *inode, struct file *file)
>  {
> -	struct seq_file *m = (struct seq_file *)file->private_data;
>  	struct ftrace_iterator *iter;
>  	struct ftrace_hash **orig_hash;
>  	struct trace_parser *parser;
> @@ -5566,6 +5565,7 @@ int ftrace_regex_release(struct inode *inode, struct file *file)
>  	int ret;
>  
>  	if (file->f_mode & FMODE_READ) {
> +		struct seq_file *m = file->private_data;
>  		iter = m->private;
>  		seq_release(inode, file);
>  	} else

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ