linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] proc: remove mark_inode_dirty() in .setattr()
@ 2023-01-31 15:08 Chao Yu
  2023-02-07 18:17 ` Alexey Dobriyan
  0 siblings, 1 reply; 2+ messages in thread
From: Chao Yu @ 2023-01-31 15:08 UTC (permalink / raw)
  To: akpm, adobriyan; +Cc: viro, linux-kernel, linux-fsdevel, 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.

Signed-off-by: Chao Yu <chao@kernel.org>
---
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(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 9e479d7d202b..16236fe9b9fe 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -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;
 }
 
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 5f52f20d5ed1..f547e9593a77 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -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;
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 48f2d60bd78a..4e71d18e610e 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -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;
 }
 
-- 
2.36.1


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

* Re: [PATCH v2] proc: remove mark_inode_dirty() in .setattr()
  2023-01-31 15:08 [PATCH v2] proc: remove mark_inode_dirty() in .setattr() Chao Yu
@ 2023-02-07 18:17 ` Alexey Dobriyan
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Dobriyan @ 2023-02-07 18:17 UTC (permalink / raw)
  To: Chao Yu; +Cc: akpm, viro, linux-kernel, linux-fsdevel

On Tue, Jan 31, 2023 at 11:08:40PM +0800, Chao Yu wrote:
> 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.

> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -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);

Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com>

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

end of thread, other threads:[~2023-02-07 18:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-31 15:08 [PATCH v2] proc: remove mark_inode_dirty() in .setattr() Chao Yu
2023-02-07 18:17 ` Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).