Skip to contentSkip to conversation

proc: remove mark_inode_dirty() in .setattr()

PATCH Applied Chao Yu 2 participants 2 messages Jan 31, 2023 – Feb 7, 2023

Subsystems (3)
lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH v2 1/1 proc: remove mark_inode_dirty() in .setattr()

procfs' .setattr() has updated i_uid, i_gid and i_mode into proc dirent, we don't need to call mark_inode_dirty() for delayed update, remove it.

---
v2:
- remove mark_inode_dirty() from proc_setattr() and proc_sys_setattr() as well.

 fs/proc/base.c        | 1 -
 fs/proc/generic.c     | 1 -
 fs/proc/proc_sysctl.c | 1 -
 3 files changed, 3 deletions(-)
fs/proc/base.c +0 -1
index 9e479d7d202b..16236fe9b9fe 100644
@@ -699,7 +699,6 @@ int proc_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
 		return error;
 
 	setattr_copy(&init_user_ns, inode, attr);
-	mark_inode_dirty(inode);
 	return 0;
 }
 
fs/proc/generic.c +0 -1
index 5f52f20d5ed1..f547e9593a77 100644
@@ -127,7 +127,6 @@ static int proc_notify_change(struct user_namespace *mnt_userns,
 		return error;
 
 	setattr_copy(&init_user_ns, inode, iattr);
-	mark_inode_dirty(inode);
 
 	proc_set_user(de, inode->i_uid, inode->i_gid);
 	de->mode = inode->i_mode;
fs/proc/proc_sysctl.c +0 -1
index 48f2d60bd78a..4e71d18e610e 100644
@@ -841,7 +841,6 @@ static int proc_sys_setattr(struct user_namespace *mnt_userns,
 		return error;
 
 	setattr_copy(&init_user_ns, inode, attr);
-	mark_inode_dirty(inode);
 	return 0;
 }
 
Signature · 1 line
2.36.1
Reviewed-by on v2 1/1
#1 lore raw

fs/proc/base.c int proc_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, · line 702

Quoted 11 lines · Chao Yu

procfs' .setattr() has updated i_uid, i_gid and i_mode into proc dirent, we don't need to call mark_inode_dirty() for delayed update, remove it.

fs/proc/base.c +0 -1
@@ -699,7 +699,6 @@ int proc_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
 		return error;
 
 	setattr_copy(&init_user_ns, inode, attr);
-	mark_inode_dirty(inode);