summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/inode.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-05-20 20:10:10 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2016-06-03 03:05:11 +0200
commit0f18b462b2e5aff64b8638e8a47284b907351ef3 (patch)
treeb39406fe286595610a0e5f785fb9913551df898d /fs/f2fs/inode.c
parentf2fs: call mark_inode_dirty_sync for i_field changes (diff)
downloadlinux-0f18b462b2e5aff64b8638e8a47284b907351ef3.tar.xz
linux-0f18b462b2e5aff64b8638e8a47284b907351ef3.zip
f2fs: flush inode metadata when checkpoint is doing
This patch registers all the inodes which have dirty metadata to sync when checkpoint is doing. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inode.c')
-rw-r--r--fs/f2fs/inode.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index 34aa0949e48c..2d892b6d5632 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -262,7 +262,7 @@ int update_inode(struct inode *inode, struct page *node_page)
__set_inode_rdev(inode, ri);
set_cold_node(inode, node_page);
- clear_inode_flag(inode, FI_DIRTY_INODE);
+ f2fs_inode_synced(inode);
/* deleted inode */
if (inode->i_nlink == 0)
@@ -286,6 +286,7 @@ retry:
} else if (err != -ENOENT) {
f2fs_stop_checkpoint(sbi, false);
}
+ f2fs_inode_synced(inode);
return 0;
}
ret = update_inode(inode, node_page);
@@ -360,6 +361,8 @@ retry:
goto retry;
}
+ if (err)
+ update_inode_page(inode);
sb_end_intwrite(inode->i_sb);
no_delete:
stat_dec_inline_xattr(inode);
@@ -381,6 +384,8 @@ no_delete:
!exist_written_data(sbi, inode->i_ino, ORPHAN_INO));
out_clear:
fscrypt_put_encryption_info(inode, NULL);
+
+ f2fs_bug_on(sbi, is_inode_flag_set(inode, FI_DIRTY_INODE));
clear_inode(inode);
}