mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexey Gladkov <gladkov.alexey@gmail.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] proc: delete redundant subset=pid check
Date: Sat, 20 Mar 2021 19:02:14 +0100	[thread overview]
Message-ID: <20210320180214.xxet7yjxivp4aiaq@example.org> (raw)
In-Reply-To: <YFYYwIBIkytqnkxP@localhost.localdomain>

On Sat, Mar 20, 2021 at 06:46:08PM +0300, Alexey Dobriyan wrote:
> Two checks in lookup and readdir code should be enough to not have
> third check in open code.
> 
> Can't open what can't be looked up?

As far as I remember, I first added pidonly processing here and later then
I disabled lookup. Now this is unnecessary.

Acked-by: Alexey Gladkov <gladkov.alexey@gmail.com>

> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
> 
>  fs/proc/inode.c |    4 ----
>  1 file changed, 4 deletions(-)
> 
> --- a/fs/proc/inode.c
> +++ b/fs/proc/inode.c
> @@ -483,7 +483,6 @@ proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr,
>  
>  static int proc_reg_open(struct inode *inode, struct file *file)
>  {
> -	struct proc_fs_info *fs_info = proc_sb_info(inode->i_sb);
>  	struct proc_dir_entry *pde = PDE(inode);
>  	int rv = 0;
>  	typeof_member(struct proc_ops, proc_open) open;
> @@ -497,9 +496,6 @@ static int proc_reg_open(struct inode *inode, struct file *file)
>  		return rv;
>  	}
>  
> -	if (fs_info->pidonly == PROC_PIDONLY_ON)
> -		return -ENOENT;
> -
>  	/*
>  	 * Ensure that
>  	 * 1) PDE's ->release hook will be called no matter what
> 

-- 
Rgrds, legion


      reply	other threads:[~2021-03-20 18:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20 15:46 Alexey Dobriyan
2021-03-20 18:02 ` Alexey Gladkov [this message]

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=20210320180214.xxet7yjxivp4aiaq@example.org \
    --to=gladkov.alexey@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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®