f2fs: fix to wait page writeback during revoking atomic write
authorChao Yu <yuchao0@huawei.com>
Mon, 23 Apr 2018 02:36:13 +0000 (10:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:55:15 +0000 (07:55 +0200)
[ Upstream commit e5e5732d8120654159254c16834bc8663d8be124 ]

After revoking atomic write, related LBA can be reused by others, so we
need to wait page writeback before reusing the LBA, in order to avoid
interference between old atomic written in-flight IO and new IO.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/segment.c

index 393039fdb26da4a2294f04044ca8be05e4a412dd..35d48ef0573cd361583599d2a7dad8081351c7cb 100644 (file)
@@ -207,6 +207,8 @@ static int __revoke_inmem_pages(struct inode *inode,
 
                lock_page(page);
 
+               f2fs_wait_on_page_writeback(page, DATA, true);
+
                if (recover) {
                        struct dnode_of_data dn;
                        struct node_info ni;