linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] proc: remove mark_inode_dirty() in proc_notify_change()
@ 2023-01-12  3:27 Chao Yu
  2023-01-12 22:43 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2023-01-12  3:27 UTC (permalink / raw)
  To: akpm, adobriyan; +Cc: viro, linux-kernel, linux-fsdevel, Chao Yu

proc_notify_change() has updated i_uid, i_gid and i_mode into proc
dirent, we don't need to call mark_inode_dirty() for later writeback,
remove it.

Signed-off-by: Chao Yu <chao@kernel.org>
---
 fs/proc/generic.c | 1 -
 1 file changed, 1 deletion(-)

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;
-- 
2.25.1


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

* Re: [PATCH] proc: remove mark_inode_dirty() in proc_notify_change()
  2023-01-12  3:27 [PATCH] proc: remove mark_inode_dirty() in proc_notify_change() Chao Yu
@ 2023-01-12 22:43 ` Andrew Morton
  2023-01-29 14:58   ` Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2023-01-12 22:43 UTC (permalink / raw)
  To: Chao Yu; +Cc: adobriyan, viro, linux-kernel, linux-fsdevel

On Thu, 12 Jan 2023 11:27:20 +0800 Chao Yu <chao@kernel.org> wrote:

> proc_notify_change() has updated i_uid, i_gid and i_mode into proc
> dirent, we don't need to call mark_inode_dirty() for later writeback,
> remove it.
> 
> --- 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;

procfs call mark_inode_dirty() in three places.

Does mark_inode_dirty() of a procfs file actually serve any purpose?

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

* Re: [PATCH] proc: remove mark_inode_dirty() in proc_notify_change()
  2023-01-12 22:43 ` Andrew Morton
@ 2023-01-29 14:58   ` Chao Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2023-01-29 14:58 UTC (permalink / raw)
  To: Andrew Morton; +Cc: adobriyan, viro, linux-kernel, linux-fsdevel

Hi Andrew,

Sorry for the long delay. :(

On 2023/1/13 6:43, Andrew Morton wrote:
> On Thu, 12 Jan 2023 11:27:20 +0800 Chao Yu <chao@kernel.org> wrote:
> 
>> proc_notify_change() has updated i_uid, i_gid and i_mode into proc
>> dirent, we don't need to call mark_inode_dirty() for later writeback,
>> remove it.
>>
>> --- 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;
> 
> procfs call mark_inode_dirty() in three places.

Correct.

> 
> Does mark_inode_dirty() of a procfs file actually serve any purpose?

I don't see any particular reason that procfs inode needs to be set dirty,
as an in-memory filesystem, there is no backing device, so all attributes
should have been updated into procfs dirent directly in .setattr().

In fact, also procfs doesn't implement .dirty_inode, .write_inode or
.writepage{,s} interfaces which serves delayed inode update, pages writeback
after inode is set as dirty.

Thanks,

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

end of thread, other threads:[~2023-01-29 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-12  3:27 [PATCH] proc: remove mark_inode_dirty() in proc_notify_change() Chao Yu
2023-01-12 22:43 ` Andrew Morton
2023-01-29 14:58   ` Chao Yu

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).