Skip to contentSkip to conversation

f2fs: commit atomic written page in LFS mode

PATCH Superseded Chao Yu 1 participant 1 message Oct 28, 2015 F2FS file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 2/2 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.

---
 fs/f2fs/data.c | 1 +
 1 file changed, 1 insertion(+)
fs/f2fs/data.c +1 -0
index e070ac0..509caee 100644
@@ -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);
Signature · 1 line
2.6.1