From: Mike Marshall Date: Wed, 8 Apr 2020 13:05:45 +0000 (-0400) Subject: orangefs: don't mess with I_DIRTY_TIMES in orangefs_flush X-Git-Tag: v5.10.7~2816^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e393a9a8f2a450862964451715d68e9a96a9c34;p=platform%2Fkernel%2Flinux-rpi.git orangefs: don't mess with I_DIRTY_TIMES in orangefs_flush Christoph Hellwig noticed that we were doing some unnecessary work in orangefs_flush: orangefs_flush just writes out data on every close(2) call. There is no need to change anything about the dirty state, especially as orangefs doesn't treat I_DIRTY_TIMES special in any way. The code seems to come from partially open coding vfs_fsync. He sent in a patch with the above commit message and also a patch that was a reversion of another Orangefs patch I had sent upstream a while ago. I had to fix his reversion patch so that it would compile which caused his "don't mess with I_DIRTY_TIMES" patch to fail to apply. So here I have just remade his patch and applied it after the fixed reversion patch. Signed-off-by: Mike Marshall --- diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index 173e6ea..af375e0 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -645,16 +645,8 @@ static int orangefs_flush(struct file *file, fl_owner_t id) * on an explicit fsync call. This duplicates historical OrangeFS * behavior. */ - struct inode *inode = file->f_mapping->host; int r; - if (inode->i_state & I_DIRTY_TIME) { - spin_lock(&inode->i_lock); - inode->i_state &= ~I_DIRTY_TIME; - spin_unlock(&inode->i_lock); - mark_inode_dirty_sync(inode); - } - r = filemap_write_and_wait_range(file->f_mapping, 0, LLONG_MAX); if (r > 0) return 0;