]> git.hungrycats.org Git - linux/commitdiff
f2fs: fix to wait on page writeback before updating page
authorChao Yu <yuchao0@huawei.com>
Thu, 21 Jun 2018 14:38:28 +0000 (22:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Sep 2018 20:41:36 +0000 (22:41 +0200)
[ Upstream commit 6aead1617b3adf2b7e2c56f0f13e4e0ee42ebb4a ]

In error path of f2fs_move_rehashed_dirents, inode page could be writeback
state, so we should wait on inode page writeback before updating it.

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/inline.c

index f882de2ede95df320d21d8d9170bc8468b7c91f6..2bcb2d36f024ed269652f674fc69bcf52bd854ce 100644 (file)
@@ -498,6 +498,7 @@ static int f2fs_move_rehashed_dirents(struct inode *dir, struct page *ipage,
        return 0;
 recover:
        lock_page(ipage);
+       f2fs_wait_on_page_writeback(ipage, NODE, true);
        memcpy(inline_dentry, backup_dentry, MAX_INLINE_DATA(dir));
        f2fs_i_depth_write(dir, 0);
        f2fs_i_size_write(dir, MAX_INLINE_DATA(dir));