On 5/17/22 4:28 AM, Jan Kara wrote: > On Mon 16-05-22 09:47:10, Stefan Roesch wrote: >> This introduces an optimization for the update time flag and async >> buffered writes. While an update of the file modification time is >> pending and is handled by the workers, concurrent writes do not need >> to wait for this time update to complete. >> >> Signed-off-by: Stefan Roesch <shr@xxxxxx> >> --- >> fs/inode.c | 1 + >> include/linux/fs.h | 3 +++ >> 2 files changed, 4 insertions(+) >> >> diff --git a/fs/inode.c b/fs/inode.c >> index 1d0b02763e98..fd18b2c1b7c4 100644 >> --- a/fs/inode.c >> +++ b/fs/inode.c >> @@ -2091,6 +2091,7 @@ static int do_file_update_time(struct inode *inode, struct file *file, >> return 0; >> >> ret = inode_update_time(inode, now, sync_mode); >> + inode->i_flags &= ~S_PENDING_TIME; > > So what protects this update of inode->i_flags? Usually we use > inode->i_rwsem for that but not all file_update_time() callers hold it... > I'll move setting the flags to the file_modified() function. > Honza >