* [PATCH 2/2] f2fs: commit atomic written page in LFS mode
@ 2015-10-28 9:56 Chao Yu
0 siblings, 0 replies; only message in thread
From: Chao Yu @ 2015-10-28 9:56 UTC (permalink / raw)
To: Jaegeuk Kim; +Cc: linux-f2fs-devel, linux-kernel
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>
---
fs/f2fs/data.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index e070ac0..509caee 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1093,6 +1093,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);
--
2.6.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-10-28 9:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-28 9:56 [PATCH 2/2] f2fs: commit atomic written page in LFS mode Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).