Use inode_is_dirty() helper in jfs_fsync() instead of explicit i_state check. This slightly changes behavior in that we no longer trigger inode commit if the inode is clean except it still has I_DIRTY_PAGES set after data writeout but that is actually a desirable behavior because commit is pointless if only folios are dirty. Signed-off-by: Jan Kara --- fs/jfs/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/jfs/file.c b/fs/jfs/file.c index 2f5bb79c0591..90001d3d90fc 100644 --- a/fs/jfs/file.c +++ b/fs/jfs/file.c @@ -27,8 +27,7 @@ int jfs_fsync(struct file *file, loff_t start, loff_t end, int datasync) return rc; inode_lock(inode); - if (!(inode_state_read_once(inode) & I_DIRTY_ALL) || - (datasync && !(inode_state_read_once(inode) & I_DIRTY_DATASYNC))) { + if (!inode_is_dirty(inode, datasync)) { /* Make sure committed changes hit the disk */ jfs_flush_journal(JFS_SBI(inode->i_sb)->log, 1); inode_unlock(inode); -- 2.53.0