aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-10-28 17:56:14 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-12-04 11:52:33 -0800
commit2da3e027461ab0148384b02bd5905f1a7b335dff (patch)
treea2cd5fbde5d57a1f594c052111053cc16529cd40
parentf2fs: report error of f2fs_create_root_stats (diff)
downloadwireguard-linux-2da3e027461ab0148384b02bd5905f1a7b335dff.tar.xz
wireguard-linux-2da3e027461ab0148384b02bd5905f1a7b335dff.zip
f2fs: commit atomic written page in LFS mode
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>
-rw-r--r--fs/f2fs/data.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 972eab7ac071..0cc8de2839c4 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -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);