From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
David Sterba <dsterba@suse.com>,
Viacheslav Dubeyko <slava@dubeyko.com>,
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
Yangtao Li <frank.li@vivo.com>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 4/5] proc: rename proc_setattr to proc_nochmod_setattr
Date: Wed, 25 Mar 2026 12:56:28 +0100 [thread overview]
Message-ID: <4hey4val36723wscgpj5uocs5izs4stzhqi2ar2dlrgi7y5qzz@lcaxnz5bts6t> (raw)
In-Reply-To: <20260325063711.3298685-5-hch@lst.de>
On Wed 25-03-26 07:36:51, Christoph Hellwig wrote:
> What is currently proc_setattr is a special version added after the more
> general procfs ->seattr in commit 6d76fa58b050 ("Don't allow chmod() on
^^^^ setattr
> the /proc/<pid>/ files"). Give it a name that reflects that to free the
> proc_setattr name and better describe what is doing.
^^^ is it
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/proc/base.c | 22 +++++++++++-----------
> fs/proc/fd.c | 6 +++---
> fs/proc/internal.h | 4 ++--
> fs/proc/namespaces.c | 4 ++--
> fs/proc/proc_net.c | 2 +-
> 5 files changed, 19 insertions(+), 19 deletions(-)
>
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 4c863d17dfb4..d9acfa89c894 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -721,7 +721,7 @@ static bool proc_fd_access_allowed(struct inode *inode)
> return allowed;
> }
>
> -int proc_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
> +int proc_nochmod_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
> struct iattr *attr)
> {
> int error;
> @@ -794,7 +794,7 @@ static int proc_pid_permission(struct mnt_idmap *idmap,
>
>
> static const struct inode_operations proc_def_inode_operations = {
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
>
> static int proc_single_show(struct seq_file *m, void *v)
> @@ -1866,7 +1866,7 @@ static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int b
> const struct inode_operations proc_pid_link_inode_operations = {
> .readlink = proc_pid_readlink,
> .get_link = proc_pid_get_link,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
>
>
> @@ -2319,7 +2319,7 @@ proc_map_files_get_link(struct dentry *dentry,
> static const struct inode_operations proc_map_files_link_inode_operations = {
> .readlink = proc_pid_readlink,
> .get_link = proc_map_files_get_link,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
>
> static struct dentry *
> @@ -2398,7 +2398,7 @@ static struct dentry *proc_map_files_lookup(struct inode *dir,
> static const struct inode_operations proc_map_files_inode_operations = {
> .lookup = proc_map_files_lookup,
> .permission = proc_fd_permission,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
>
> static int
> @@ -2885,7 +2885,7 @@ static struct dentry *proc_##LSM##_attr_dir_lookup(struct inode *dir, \
> static const struct inode_operations proc_##LSM##_attr_dir_inode_ops = { \
> .lookup = proc_##LSM##_attr_dir_lookup, \
> .getattr = pid_getattr, \
> - .setattr = proc_setattr, \
> + .setattr = proc_nochmod_setattr, \
> }
>
> #ifdef CONFIG_SECURITY_SMACK
> @@ -2944,7 +2944,7 @@ static struct dentry *proc_attr_dir_lookup(struct inode *dir,
> static const struct inode_operations proc_attr_dir_inode_operations = {
> .lookup = proc_attr_dir_lookup,
> .getattr = pid_getattr,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
>
> #endif
> @@ -3453,7 +3453,7 @@ static struct dentry *proc_tgid_base_lookup(struct inode *dir, struct dentry *de
> static const struct inode_operations proc_tgid_base_inode_operations = {
> .lookup = proc_tgid_base_lookup,
> .getattr = pid_getattr,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> .permission = proc_pid_permission,
> };
>
> @@ -3650,7 +3650,7 @@ static int proc_tid_comm_permission(struct mnt_idmap *idmap,
> }
>
> static const struct inode_operations proc_tid_comm_inode_operations = {
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> .permission = proc_tid_comm_permission,
> };
>
> @@ -3779,7 +3779,7 @@ static const struct file_operations proc_tid_base_operations = {
> static const struct inode_operations proc_tid_base_inode_operations = {
> .lookup = proc_tid_base_lookup,
> .getattr = pid_getattr,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
>
> static struct dentry *proc_task_instantiate(struct dentry *dentry,
> @@ -3992,7 +3992,7 @@ static loff_t proc_dir_llseek(struct file *file, loff_t offset, int whence)
> static const struct inode_operations proc_task_inode_operations = {
> .lookup = proc_task_lookup,
> .getattr = proc_task_getattr,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> .permission = proc_pid_permission,
> };
>
> diff --git a/fs/proc/fd.c b/fs/proc/fd.c
> index 9eeccff49b2a..8a48ff4a19ec 100644
> --- a/fs/proc/fd.c
> +++ b/fs/proc/fd.c
> @@ -102,7 +102,7 @@ static int proc_fdinfo_permission(struct mnt_idmap *idmap, struct inode *inode,
>
> static const struct inode_operations proc_fdinfo_file_inode_operations = {
> .permission = proc_fdinfo_permission,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
>
> static const struct file_operations proc_fdinfo_file_operations = {
> @@ -361,7 +361,7 @@ const struct inode_operations proc_fd_inode_operations = {
> .lookup = proc_lookupfd,
> .permission = proc_fd_permission,
> .getattr = proc_fd_getattr,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
>
> static struct dentry *proc_fdinfo_instantiate(struct dentry *dentry,
> @@ -402,7 +402,7 @@ static int proc_fdinfo_iterate(struct file *file, struct dir_context *ctx)
> const struct inode_operations proc_fdinfo_inode_operations = {
> .lookup = proc_lookupfdinfo,
> .permission = proc_fdinfo_permission,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
>
> const struct file_operations proc_fdinfo_operations = {
> diff --git a/fs/proc/internal.h b/fs/proc/internal.h
> index c1e8eb984da8..64dc44832808 100644
> --- a/fs/proc/internal.h
> +++ b/fs/proc/internal.h
> @@ -257,8 +257,8 @@ extern int proc_pid_statm(struct seq_file *, struct pid_namespace *,
> extern const struct dentry_operations pid_dentry_operations;
> extern int pid_getattr(struct mnt_idmap *, const struct path *,
> struct kstat *, u32, unsigned int);
> -extern int proc_setattr(struct mnt_idmap *, struct dentry *,
> - struct iattr *);
> +int proc_nochmod_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
> + struct iattr *attr);
> extern void proc_pid_evict_inode(struct proc_inode *);
> extern struct inode *proc_pid_make_inode(struct super_block *, struct task_struct *, umode_t);
> extern void pid_update_inode(struct task_struct *, struct inode *);
> diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c
> index ea2b597fd92c..39f4169f669f 100644
> --- a/fs/proc/namespaces.c
> +++ b/fs/proc/namespaces.c
> @@ -92,7 +92,7 @@ static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int bufl
> static const struct inode_operations proc_ns_link_inode_operations = {
> .readlink = proc_ns_readlink,
> .get_link = proc_ns_get_link,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
>
> static struct dentry *proc_ns_instantiate(struct dentry *dentry,
> @@ -178,5 +178,5 @@ static struct dentry *proc_ns_dir_lookup(struct inode *dir,
> const struct inode_operations proc_ns_dir_inode_operations = {
> .lookup = proc_ns_dir_lookup,
> .getattr = pid_getattr,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
> diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
> index 52f0b75cbce2..184cddeb8215 100644
> --- a/fs/proc/proc_net.c
> +++ b/fs/proc/proc_net.c
> @@ -322,7 +322,7 @@ static int proc_tgid_net_getattr(struct mnt_idmap *idmap,
> const struct inode_operations proc_net_inode_operations = {
> .lookup = proc_tgid_net_lookup,
> .getattr = proc_tgid_net_getattr,
> - .setattr = proc_setattr,
> + .setattr = proc_nochmod_setattr,
> };
>
> static int proc_tgid_net_readdir(struct file *file, struct dir_context *ctx)
> --
> 2.47.3
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2026-03-25 11:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 6:36 trivial ->setattr cleanups Christoph Hellwig
2026-03-25 6:36 ` [PATCH 1/5] hfs: update comments on hfs_inode_setattr Christoph Hellwig
2026-03-25 11:52 ` Jan Kara
2026-03-25 16:38 ` vdubeyko
2026-03-25 6:36 ` [PATCH 2/5] adfs: rename adfs_notify_change to adfs_setattr Christoph Hellwig
2026-03-25 11:53 ` Jan Kara
2026-03-25 6:36 ` [PATCH 3/5] affs: rename affs_notify_change to affs_setattr Christoph Hellwig
2026-03-25 11:54 ` Jan Kara
2026-03-25 6:36 ` [PATCH 4/5] proc: rename proc_setattr to proc_nochmod_setattr Christoph Hellwig
2026-03-25 11:56 ` Jan Kara [this message]
2026-03-25 6:36 ` [PATCH 5/5] proc: rename proc_notify_change to proc_setattr Christoph Hellwig
2026-03-25 12:12 ` Jan Kara
2026-03-26 14:18 ` trivial ->setattr cleanups Christian Brauner
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=4hey4val36723wscgpj5uocs5izs4stzhqi2ar2dlrgi7y5qzz@lcaxnz5bts6t \
--to=jack@suse.cz \
--cc=brauner@kernel.org \
--cc=dsterba@suse.com \
--cc=frank.li@vivo.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=slava@dubeyko.com \
--cc=viro@zeniv.linux.org.uk \
/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