public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* trivial ->setattr cleanups
@ 2026-03-25  6:36 Christoph Hellwig
  2026-03-25  6:36 ` [PATCH 1/5] hfs: update comments on hfs_inode_setattr Christoph Hellwig
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Christoph Hellwig @ 2026-03-25  6:36 UTC (permalink / raw)
  To: Al Viro, Christian Brauner, David Sterba, Viacheslav Dubeyko,
	John Paul Adrian Glaubitz, Yangtao Li
  Cc: Jan Kara, linux-fsdevel

Hi all,

I've been looking into changes to ->setattr and noticed that we still
have a few instances where the method has the ages old notify_change
name.  Fix this up and include dusting off outdated comments.

Diffstat:
 adfs/adfs.h       |    4 ++--
 adfs/dir.c        |    2 +-
 adfs/file.c       |    2 +-
 adfs/inode.c      |    6 ++----
 affs/affs.h       |    2 +-
 affs/dir.c        |    2 +-
 affs/file.c       |    2 +-
 affs/inode.c      |    5 ++---
 affs/symlink.c    |    2 +-
 hfs/inode.c       |   21 ++-------------------
 proc/base.c       |   22 +++++++++++-----------
 proc/fd.c         |    6 +++---
 proc/generic.c    |    8 ++++----
 proc/internal.h   |    4 ++--
 proc/namespaces.c |    4 ++--
 proc/proc_net.c   |    2 +-
 16 files changed, 37 insertions(+), 57 deletions(-)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/5] hfs: update comments on hfs_inode_setattr
  2026-03-25  6:36 trivial ->setattr cleanups Christoph Hellwig
@ 2026-03-25  6:36 ` 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
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 13+ messages in thread
From: Christoph Hellwig @ 2026-03-25  6:36 UTC (permalink / raw)
  To: Al Viro, Christian Brauner, David Sterba, Viacheslav Dubeyko,
	John Paul Adrian Glaubitz, Yangtao Li
  Cc: Jan Kara, linux-fsdevel

The top of function comment about hfs_inode_setattr is severely out
of date and reference a previous name for this function.  Remove it,
and update the comments in the file to record the still relevant bits
directly.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/hfs/inode.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index 878535db64d6..72948eb2fadc 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -622,23 +622,6 @@ static int hfs_file_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-/*
- * hfs_notify_change()
- *
- * Based very closely on fs/msdos/inode.c by Werner Almesberger
- *
- * This is the notify_change() field in the super_operations structure
- * for HFS file systems.  The purpose is to take that changes made to
- * an inode and apply then in a filesystem-dependent manner.  In this
- * case the process has a few of tasks to do:
- *  1) prevent changes to the i_uid and i_gid fields.
- *  2) map file permissions to the closest allowable permissions
- *  3) Since multiple Linux files can share the same on-disk inode under
- *     HFS (for instance the data and resource forks of a file) a change
- *     to permissions must be applied to all other in-core inodes which
- *     correspond to the same HFS file.
- */
-
 int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 		      struct iattr *attr)
 {
@@ -646,8 +629,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 	struct hfs_sb_info *hsb = HFS_SB(inode->i_sb);
 	int error;
 
-	error = setattr_prepare(&nop_mnt_idmap, dentry,
-				attr); /* basic permission checks */
+	error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
 	if (error)
 		return error;
 
@@ -663,6 +645,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 		return hsb->s_quiet ? 0 : error;
 	}
 
+	/* map file permissions to the closest allowable permissions in HFS */
 	if (attr->ia_valid & ATTR_MODE) {
 		/* Only the 'w' bits can ever change and only all together. */
 		if (attr->ia_mode & S_IWUSR)
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/5] adfs: rename adfs_notify_change to adfs_setattr
  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  6:36 ` 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
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2026-03-25  6:36 UTC (permalink / raw)
  To: Al Viro, Christian Brauner, David Sterba, Viacheslav Dubeyko,
	John Paul Adrian Glaubitz, Yangtao Li
  Cc: Jan Kara, linux-fsdevel

Make the function name match the method that it implements.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/adfs/adfs.h  | 4 ++--
 fs/adfs/dir.c   | 2 +-
 fs/adfs/file.c  | 2 +-
 fs/adfs/inode.c | 6 ++----
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/fs/adfs/adfs.h b/fs/adfs/adfs.h
index 223f0283d20f..0d32b7cd99b4 100644
--- a/fs/adfs/adfs.h
+++ b/fs/adfs/adfs.h
@@ -144,8 +144,8 @@ struct adfs_discmap {
 /* Inode stuff */
 struct inode *adfs_iget(struct super_block *sb, struct object_info *obj);
 int adfs_write_inode(struct inode *inode, struct writeback_control *wbc);
-int adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
-		       struct iattr *attr);
+int adfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
+		struct iattr *attr);
 
 /* map.c */
 int adfs_map_lookup(struct super_block *sb, u32 frag_id, unsigned int offset);
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c
index 493500f37cb9..309c0a88cabb 100644
--- a/fs/adfs/dir.c
+++ b/fs/adfs/dir.c
@@ -454,5 +454,5 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
  */
 const struct inode_operations adfs_dir_inode_operations = {
 	.lookup		= adfs_lookup,
-	.setattr	= adfs_notify_change,
+	.setattr	= adfs_setattr,
 };
diff --git a/fs/adfs/file.c b/fs/adfs/file.c
index cd13165fd904..73486667d6b4 100644
--- a/fs/adfs/file.c
+++ b/fs/adfs/file.c
@@ -32,5 +32,5 @@ const struct file_operations adfs_file_operations = {
 };
 
 const struct inode_operations adfs_file_inode_operations = {
-	.setattr	= adfs_notify_change,
+	.setattr	= adfs_setattr,
 };
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
index 6830f8bc8d4e..4ac442d0a8c0 100644
--- a/fs/adfs/inode.c
+++ b/fs/adfs/inode.c
@@ -299,8 +299,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj)
  * later.
  */
 int
-adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
-		   struct iattr *attr)
+adfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr)
 {
 	struct inode *inode = d_inode(dentry);
 	struct super_block *sb = inode->i_sb;
@@ -355,8 +354,7 @@ adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
 
 /*
  * write an existing inode back to the directory, and therefore the disk.
- * The adfs-specific inode data has already been updated by
- * adfs_notify_change()
+ * The adfs-specific inode data has already been updated by * adfs_setattr().
  */
 int adfs_write_inode(struct inode *inode, struct writeback_control *wbc)
 {
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/5] affs: rename affs_notify_change to affs_setattr
  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  6:36 ` [PATCH 2/5] adfs: rename adfs_notify_change to adfs_setattr Christoph Hellwig
@ 2026-03-25  6:36 ` 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
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2026-03-25  6:36 UTC (permalink / raw)
  To: Al Viro, Christian Brauner, David Sterba, Viacheslav Dubeyko,
	John Paul Adrian Glaubitz, Yangtao Li
  Cc: Jan Kara, linux-fsdevel

Make the function name match the method that it implements.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/affs/affs.h    | 2 +-
 fs/affs/dir.c     | 2 +-
 fs/affs/file.c    | 2 +-
 fs/affs/inode.c   | 5 ++---
 fs/affs/symlink.c | 2 +-
 5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/fs/affs/affs.h b/fs/affs/affs.h
index ac4e9a02910b..43e20b02b449 100644
--- a/fs/affs/affs.h
+++ b/fs/affs/affs.h
@@ -184,7 +184,7 @@ extern int	affs_rename2(struct mnt_idmap *idmap,
 /* inode.c */
 
 extern struct inode		*affs_new_inode(struct inode *dir);
-extern int			 affs_notify_change(struct mnt_idmap *idmap,
+extern int			 affs_setattr(struct mnt_idmap *idmap,
 					struct dentry *dentry, struct iattr *attr);
 extern void			 affs_evict_inode(struct inode *inode);
 extern struct inode		*affs_iget(struct super_block *sb,
diff --git a/fs/affs/dir.c b/fs/affs/dir.c
index 5c8d83387a39..c53b98f7c687 100644
--- a/fs/affs/dir.c
+++ b/fs/affs/dir.c
@@ -71,7 +71,7 @@ const struct inode_operations affs_dir_inode_operations = {
 	.mkdir		= affs_mkdir,
 	.rmdir		= affs_rmdir,
 	.rename		= affs_rename2,
-	.setattr	= affs_notify_change,
+	.setattr	= affs_setattr,
 };
 
 static int
diff --git a/fs/affs/file.c b/fs/affs/file.c
index 6c9258359ddb..cede4bb1134e 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -1013,5 +1013,5 @@ const struct file_operations affs_file_operations = {
 };
 
 const struct inode_operations affs_file_inode_operations = {
-	.setattr	= affs_notify_change,
+	.setattr	= affs_setattr,
 };
diff --git a/fs/affs/inode.c b/fs/affs/inode.c
index 0bfc7d151dcd..f660e76584b3 100644
--- a/fs/affs/inode.c
+++ b/fs/affs/inode.c
@@ -213,13 +213,12 @@ affs_write_inode(struct inode *inode, struct writeback_control *wbc)
 }
 
 int
-affs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
-		   struct iattr *attr)
+affs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr)
 {
 	struct inode *inode = d_inode(dentry);
 	int error;
 
-	pr_debug("notify_change(%lu,0x%x)\n", inode->i_ino, attr->ia_valid);
+	pr_debug("setattr(%lu,0x%x)\n", inode->i_ino, attr->ia_valid);
 
 	error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
 	if (error)
diff --git a/fs/affs/symlink.c b/fs/affs/symlink.c
index 094aec8d17b8..af6147e1d975 100644
--- a/fs/affs/symlink.c
+++ b/fs/affs/symlink.c
@@ -71,5 +71,5 @@ const struct address_space_operations affs_symlink_aops = {
 
 const struct inode_operations affs_symlink_inode_operations = {
 	.get_link	= page_get_link,
-	.setattr	= affs_notify_change,
+	.setattr	= affs_setattr,
 };
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/5] proc: rename proc_setattr to proc_nochmod_setattr
  2026-03-25  6:36 trivial ->setattr cleanups Christoph Hellwig
                   ` (2 preceding siblings ...)
  2026-03-25  6:36 ` [PATCH 3/5] affs: rename affs_notify_change to affs_setattr Christoph Hellwig
@ 2026-03-25  6:36 ` Christoph Hellwig
  2026-03-25 11:56   ` Jan Kara
  2026-03-25  6:36 ` [PATCH 5/5] proc: rename proc_notify_change to proc_setattr Christoph Hellwig
  2026-03-26 14:18 ` trivial ->setattr cleanups Christian Brauner
  5 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2026-03-25  6:36 UTC (permalink / raw)
  To: Al Viro, Christian Brauner, David Sterba, Viacheslav Dubeyko,
	John Paul Adrian Glaubitz, Yangtao Li
  Cc: Jan Kara, linux-fsdevel

What is currently proc_setattr is a special version added after the more
general procfs ->seattr in commit 6d76fa58b050 ("Don't allow chmod() on
the /proc/<pid>/ files").  Give it a name that reflects that to free the
proc_setattr name and better describe what is doing.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/5] proc: rename proc_notify_change to proc_setattr
  2026-03-25  6:36 trivial ->setattr cleanups Christoph Hellwig
                   ` (3 preceding siblings ...)
  2026-03-25  6:36 ` [PATCH 4/5] proc: rename proc_setattr to proc_nochmod_setattr Christoph Hellwig
@ 2026-03-25  6:36 ` Christoph Hellwig
  2026-03-25 12:12   ` Jan Kara
  2026-03-26 14:18 ` trivial ->setattr cleanups Christian Brauner
  5 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2026-03-25  6:36 UTC (permalink / raw)
  To: Al Viro, Christian Brauner, David Sterba, Viacheslav Dubeyko,
	John Paul Adrian Glaubitz, Yangtao Li
  Cc: Jan Kara, linux-fsdevel

Make the function name match the method that it implements.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/proc/generic.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 501889856461..8bb81e58c9d8 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -115,8 +115,8 @@ static bool pde_subdir_insert(struct proc_dir_entry *dir,
 	return true;
 }
 
-static int proc_notify_change(struct mnt_idmap *idmap,
-			      struct dentry *dentry, struct iattr *iattr)
+static int proc_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
+		struct iattr *iattr)
 {
 	struct inode *inode = d_inode(dentry);
 	struct proc_dir_entry *de = PDE(inode);
@@ -151,7 +151,7 @@ static int proc_getattr(struct mnt_idmap *idmap,
 }
 
 static const struct inode_operations proc_file_inode_operations = {
-	.setattr	= proc_notify_change,
+	.setattr	= proc_setattr,
 };
 
 /*
@@ -364,7 +364,7 @@ const struct dentry_operations proc_net_dentry_ops = {
 static const struct inode_operations proc_dir_inode_operations = {
 	.lookup		= proc_lookup,
 	.getattr	= proc_getattr,
-	.setattr	= proc_notify_change,
+	.setattr	= proc_setattr,
 };
 
 static void pde_set_flags(struct proc_dir_entry *pde)
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/5] hfs: update comments on hfs_inode_setattr
  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
  1 sibling, 0 replies; 13+ messages in thread
From: Jan Kara @ 2026-03-25 11:52 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Al Viro, Christian Brauner, David Sterba, Viacheslav Dubeyko,
	John Paul Adrian Glaubitz, Yangtao Li, Jan Kara, linux-fsdevel

On Wed 25-03-26 07:36:48, Christoph Hellwig wrote:
> The top of function comment about hfs_inode_setattr is severely out
> of date and reference a previous name for this function.  Remove it,
> and update the comments in the file to record the still relevant bits
> directly.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

I agree the comments seem really outdated. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/hfs/inode.c | 21 ++-------------------
>  1 file changed, 2 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
> index 878535db64d6..72948eb2fadc 100644
> --- a/fs/hfs/inode.c
> +++ b/fs/hfs/inode.c
> @@ -622,23 +622,6 @@ static int hfs_file_release(struct inode *inode, struct file *file)
>  	return 0;
>  }
>  
> -/*
> - * hfs_notify_change()
> - *
> - * Based very closely on fs/msdos/inode.c by Werner Almesberger
> - *
> - * This is the notify_change() field in the super_operations structure
> - * for HFS file systems.  The purpose is to take that changes made to
> - * an inode and apply then in a filesystem-dependent manner.  In this
> - * case the process has a few of tasks to do:
> - *  1) prevent changes to the i_uid and i_gid fields.
> - *  2) map file permissions to the closest allowable permissions
> - *  3) Since multiple Linux files can share the same on-disk inode under
> - *     HFS (for instance the data and resource forks of a file) a change
> - *     to permissions must be applied to all other in-core inodes which
> - *     correspond to the same HFS file.
> - */
> -
>  int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
>  		      struct iattr *attr)
>  {
> @@ -646,8 +629,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
>  	struct hfs_sb_info *hsb = HFS_SB(inode->i_sb);
>  	int error;
>  
> -	error = setattr_prepare(&nop_mnt_idmap, dentry,
> -				attr); /* basic permission checks */
> +	error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
>  	if (error)
>  		return error;
>  
> @@ -663,6 +645,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
>  		return hsb->s_quiet ? 0 : error;
>  	}
>  
> +	/* map file permissions to the closest allowable permissions in HFS */
>  	if (attr->ia_valid & ATTR_MODE) {
>  		/* Only the 'w' bits can ever change and only all together. */
>  		if (attr->ia_mode & S_IWUSR)
> -- 
> 2.47.3
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/5] adfs: rename adfs_notify_change to adfs_setattr
  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
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Kara @ 2026-03-25 11:53 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Al Viro, Christian Brauner, David Sterba, Viacheslav Dubeyko,
	John Paul Adrian Glaubitz, Yangtao Li, Jan Kara, linux-fsdevel

On Wed 25-03-26 07:36:49, Christoph Hellwig wrote:
> Make the function name match the method that it implements.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

One typo correction below:

>  /*
>   * write an existing inode back to the directory, and therefore the disk.
> - * The adfs-specific inode data has already been updated by
> - * adfs_notify_change()
> + * The adfs-specific inode data has already been updated by * adfs_setattr().
							      ^^^ spurious *

>   */
>  int adfs_write_inode(struct inode *inode, struct writeback_control *wbc)
>  {

									Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/5] affs: rename affs_notify_change to affs_setattr
  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
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Kara @ 2026-03-25 11:54 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Al Viro, Christian Brauner, David Sterba, Viacheslav Dubeyko,
	John Paul Adrian Glaubitz, Yangtao Li, Jan Kara, linux-fsdevel

On Wed 25-03-26 07:36:50, Christoph Hellwig wrote:
> Make the function name match the method that it implements.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/affs/affs.h    | 2 +-
>  fs/affs/dir.c     | 2 +-
>  fs/affs/file.c    | 2 +-
>  fs/affs/inode.c   | 5 ++---
>  fs/affs/symlink.c | 2 +-
>  5 files changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/affs/affs.h b/fs/affs/affs.h
> index ac4e9a02910b..43e20b02b449 100644
> --- a/fs/affs/affs.h
> +++ b/fs/affs/affs.h
> @@ -184,7 +184,7 @@ extern int	affs_rename2(struct mnt_idmap *idmap,
>  /* inode.c */
>  
>  extern struct inode		*affs_new_inode(struct inode *dir);
> -extern int			 affs_notify_change(struct mnt_idmap *idmap,
> +extern int			 affs_setattr(struct mnt_idmap *idmap,
>  					struct dentry *dentry, struct iattr *attr);
>  extern void			 affs_evict_inode(struct inode *inode);
>  extern struct inode		*affs_iget(struct super_block *sb,
> diff --git a/fs/affs/dir.c b/fs/affs/dir.c
> index 5c8d83387a39..c53b98f7c687 100644
> --- a/fs/affs/dir.c
> +++ b/fs/affs/dir.c
> @@ -71,7 +71,7 @@ const struct inode_operations affs_dir_inode_operations = {
>  	.mkdir		= affs_mkdir,
>  	.rmdir		= affs_rmdir,
>  	.rename		= affs_rename2,
> -	.setattr	= affs_notify_change,
> +	.setattr	= affs_setattr,
>  };
>  
>  static int
> diff --git a/fs/affs/file.c b/fs/affs/file.c
> index 6c9258359ddb..cede4bb1134e 100644
> --- a/fs/affs/file.c
> +++ b/fs/affs/file.c
> @@ -1013,5 +1013,5 @@ const struct file_operations affs_file_operations = {
>  };
>  
>  const struct inode_operations affs_file_inode_operations = {
> -	.setattr	= affs_notify_change,
> +	.setattr	= affs_setattr,
>  };
> diff --git a/fs/affs/inode.c b/fs/affs/inode.c
> index 0bfc7d151dcd..f660e76584b3 100644
> --- a/fs/affs/inode.c
> +++ b/fs/affs/inode.c
> @@ -213,13 +213,12 @@ affs_write_inode(struct inode *inode, struct writeback_control *wbc)
>  }
>  
>  int
> -affs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
> -		   struct iattr *attr)
> +affs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr)
>  {
>  	struct inode *inode = d_inode(dentry);
>  	int error;
>  
> -	pr_debug("notify_change(%lu,0x%x)\n", inode->i_ino, attr->ia_valid);
> +	pr_debug("setattr(%lu,0x%x)\n", inode->i_ino, attr->ia_valid);
>  
>  	error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
>  	if (error)
> diff --git a/fs/affs/symlink.c b/fs/affs/symlink.c
> index 094aec8d17b8..af6147e1d975 100644
> --- a/fs/affs/symlink.c
> +++ b/fs/affs/symlink.c
> @@ -71,5 +71,5 @@ const struct address_space_operations affs_symlink_aops = {
>  
>  const struct inode_operations affs_symlink_inode_operations = {
>  	.get_link	= page_get_link,
> -	.setattr	= affs_notify_change,
> +	.setattr	= affs_setattr,
>  };
> -- 
> 2.47.3
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/5] proc: rename proc_setattr to proc_nochmod_setattr
  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
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Kara @ 2026-03-25 11:56 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Al Viro, Christian Brauner, David Sterba, Viacheslav Dubeyko,
	John Paul Adrian Glaubitz, Yangtao Li, Jan Kara, linux-fsdevel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 5/5] proc: rename proc_notify_change to proc_setattr
  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
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Kara @ 2026-03-25 12:12 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Al Viro, Christian Brauner, David Sterba, Viacheslav Dubeyko,
	John Paul Adrian Glaubitz, Yangtao Li, Jan Kara, linux-fsdevel

On Wed 25-03-26 07:36:52, Christoph Hellwig wrote:
> Make the function name match the method that it implements.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/proc/generic.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/proc/generic.c b/fs/proc/generic.c
> index 501889856461..8bb81e58c9d8 100644
> --- a/fs/proc/generic.c
> +++ b/fs/proc/generic.c
> @@ -115,8 +115,8 @@ static bool pde_subdir_insert(struct proc_dir_entry *dir,
>  	return true;
>  }
>  
> -static int proc_notify_change(struct mnt_idmap *idmap,
> -			      struct dentry *dentry, struct iattr *iattr)
> +static int proc_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
> +		struct iattr *iattr)
>  {
>  	struct inode *inode = d_inode(dentry);
>  	struct proc_dir_entry *de = PDE(inode);
> @@ -151,7 +151,7 @@ static int proc_getattr(struct mnt_idmap *idmap,
>  }
>  
>  static const struct inode_operations proc_file_inode_operations = {
> -	.setattr	= proc_notify_change,
> +	.setattr	= proc_setattr,
>  };
>  
>  /*
> @@ -364,7 +364,7 @@ const struct dentry_operations proc_net_dentry_ops = {
>  static const struct inode_operations proc_dir_inode_operations = {
>  	.lookup		= proc_lookup,
>  	.getattr	= proc_getattr,
> -	.setattr	= proc_notify_change,
> +	.setattr	= proc_setattr,
>  };
>  
>  static void pde_set_flags(struct proc_dir_entry *pde)
> -- 
> 2.47.3
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/5] hfs: update comments on hfs_inode_setattr
  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
  1 sibling, 0 replies; 13+ messages in thread
From: vdubeyko @ 2026-03-25 16:38 UTC (permalink / raw)
  To: Christoph Hellwig, Al Viro, Christian Brauner, David Sterba,
	Viacheslav Dubeyko, John Paul Adrian Glaubitz, Yangtao Li
  Cc: Jan Kara, linux-fsdevel

On Wed, 2026-03-25 at 07:36 +0100, Christoph Hellwig wrote:
> The top of function comment about hfs_inode_setattr is severely out
> of date and reference a previous name for this function.  Remove it,
> and update the comments in the file to record the still relevant bits
> directly.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/hfs/inode.c | 21 ++-------------------
>  1 file changed, 2 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
> index 878535db64d6..72948eb2fadc 100644
> --- a/fs/hfs/inode.c
> +++ b/fs/hfs/inode.c
> @@ -622,23 +622,6 @@ static int hfs_file_release(struct inode *inode, struct file *file)
>  	return 0;
>  }
>  
> -/*
> - * hfs_notify_change()
> - *
> - * Based very closely on fs/msdos/inode.c by Werner Almesberger
> - *
> - * This is the notify_change() field in the super_operations structure
> - * for HFS file systems.  The purpose is to take that changes made to
> - * an inode and apply then in a filesystem-dependent manner.  In this
> - * case the process has a few of tasks to do:
> - *  1) prevent changes to the i_uid and i_gid fields.
> - *  2) map file permissions to the closest allowable permissions
> - *  3) Since multiple Linux files can share the same on-disk inode under
> - *     HFS (for instance the data and resource forks of a file) a change
> - *     to permissions must be applied to all other in-core inodes which
> - *     correspond to the same HFS file.
> - */
> -
>  int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
>  		      struct iattr *attr)
>  {
> @@ -646,8 +629,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
>  	struct hfs_sb_info *hsb = HFS_SB(inode->i_sb);
>  	int error;
>  
> -	error = setattr_prepare(&nop_mnt_idmap, dentry,
> -				attr); /* basic permission checks */
> +	error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
>  	if (error)
>  		return error;
>  
> @@ -663,6 +645,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
>  		return hsb->s_quiet ? 0 : error;
>  	}
>  
> +	/* map file permissions to the closest allowable permissions in HFS */
>  	if (attr->ia_valid & ATTR_MODE) {
>  		/* Only the 'w' bits can ever change and only all together. */
>  		if (attr->ia_mode & S_IWUSR)

Makes sense.

Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>

Thanks,
Slava.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: trivial ->setattr cleanups
  2026-03-25  6:36 trivial ->setattr cleanups Christoph Hellwig
                   ` (4 preceding siblings ...)
  2026-03-25  6:36 ` [PATCH 5/5] proc: rename proc_notify_change to proc_setattr Christoph Hellwig
@ 2026-03-26 14:18 ` Christian Brauner
  5 siblings, 0 replies; 13+ messages in thread
From: Christian Brauner @ 2026-03-26 14:18 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Christian Brauner, Jan Kara, linux-fsdevel, Al Viro, David Sterba,
	Viacheslav Dubeyko, John Paul Adrian Glaubitz, Yangtao Li

On Wed, 25 Mar 2026 07:36:47 +0100, Christoph Hellwig wrote:
> I've been looking into changes to ->setattr and noticed that we still
> have a few instances where the method has the ages old notify_change
> name.  Fix this up and include dusting off outdated comments.
> 
> Diffstat:
>  adfs/adfs.h       |    4 ++--
>  adfs/dir.c        |    2 +-
>  adfs/file.c       |    2 +-
>  adfs/inode.c      |    6 ++----
>  affs/affs.h       |    2 +-
>  affs/dir.c        |    2 +-
>  affs/file.c       |    2 +-
>  affs/inode.c      |    5 ++---
>  affs/symlink.c    |    2 +-
>  hfs/inode.c       |   21 ++-------------------
>  proc/base.c       |   22 +++++++++++-----------
>  proc/fd.c         |    6 +++---
>  proc/generic.c    |    8 ++++----
>  proc/internal.h   |    4 ++--
>  proc/namespaces.c |    4 ++--
>  proc/proc_net.c   |    2 +-
>  16 files changed, 37 insertions(+), 57 deletions(-)
> 
> [...]

Applied to the vfs-7.1.misc branch of the vfs/vfs.git tree.
Patches in the vfs-7.1.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.1.misc

[1/5] hfs: update comments on hfs_inode_setattr
      https://git.kernel.org/vfs/vfs/c/d1312979f155
[2/5] adfs: rename adfs_notify_change to adfs_setattr
      https://git.kernel.org/vfs/vfs/c/9c71de5f4ddc
[3/5] affs: rename affs_notify_change to affs_setattr
      https://git.kernel.org/vfs/vfs/c/d0fdc1c0d0f6
[4/5] proc: rename proc_setattr to proc_nochmod_setattr
      https://git.kernel.org/vfs/vfs/c/690005b0b1e6
[5/5] proc: rename proc_notify_change to proc_setattr
      https://git.kernel.org/vfs/vfs/c/2ecd46d161fa

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-03-26 14:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox