* [PATCH] proc: delete redundant subset=pid check
@ 2021-03-20 15:46 Alexey Dobriyan
2021-03-20 18:02 ` Alexey Gladkov
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2021-03-20 15:46 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, linux-fsdevel, gladkov.alexey
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?
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] proc: delete redundant subset=pid check
2021-03-20 15:46 [PATCH] proc: delete redundant subset=pid check Alexey Dobriyan
@ 2021-03-20 18:02 ` Alexey Gladkov
0 siblings, 0 replies; 2+ messages in thread
From: Alexey Gladkov @ 2021-03-20 18:02 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: akpm, linux-kernel, linux-fsdevel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-20 18:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-20 15:46 [PATCH] proc: delete redundant subset=pid check Alexey Dobriyan
2021-03-20 18:02 ` Alexey Gladkov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.