f2fs: commit atomic written page in LFS mode
authorChao Yu <chao2.yu@samsung.com>
Wed, 28 Oct 2015 09:56:14 +0000 (17:56 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 4 Dec 2015 19:52:33 +0000 (11:52 -0800)
We should always commit atomic written pages in LFS mode, otherwise data
will become corrupted if we encounter suddent power cut after partial
pages committed in IPU mode.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 972eab7ac07193da485df3efc6b6c11c99dacd97..0cc8de2839c41b5ea95c1bbf54b91f376013c8c8 100644 (file)
@@ -1083,6 +1083,7 @@ int do_write_data_page(struct f2fs_io_info *fio)
         */
        if (unlikely(fio->blk_addr != NEW_ADDR &&
                        !is_cold_data(page) &&
+                       !IS_ATOMIC_WRITTEN_PAGE(page) &&
                        need_inplace_update(inode))) {
                rewrite_data_page(fio);
                set_inode_flag(F2FS_I(inode), FI_UPDATE_WRITE);