f2fs: fix to dirty inode synchronously
authorChao Yu <yuchao0@huawei.com>
Tue, 18 Dec 2018 11:20:17 +0000 (19:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:37:48 +0000 (15:37 +0100)
[ Upstream commit b32e019049e959ee10ec359893c9dd5d057dad55 ]

If user change inode's i_flags via ioctl, let's add it into global
dirty list, so that checkpoint can guarantee its persistence before
fsync, it can make checkpoint keeping strong consistency.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/file.c

index 1b1792199445982496bec11c8352c573c5e944aa..d68b0132718a6a2696bf39a2fa6eda43cc00a30f 100644 (file)
@@ -1593,7 +1593,7 @@ static int __f2fs_ioc_setflags(struct inode *inode, unsigned int flags)
 
        inode->i_ctime = current_time(inode);
        f2fs_set_inode_flags(inode);
-       f2fs_mark_inode_dirty_sync(inode, false);
+       f2fs_mark_inode_dirty_sync(inode, true);
        return 0;
 }