From e518ff81c337e39b9b63d92ba41e4512521d7c9c Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Fri, 9 Aug 2013 14:46:15 +0900 Subject: f2fs: fix inconsistency between xattr node blocks and its inode Previously xattr node blocks are stored to the COLD_NODE log, which means that our roll-forward mechanism doesn't recover the xattr node blocks at all. Only the direct node blocks in the WARM_NODE log can be recovered. So, let's resolve the issue simply by conducting checkpoint during fsync when a file has a modified xattr node block. This approach is able to degrade the performance, but normally the checkpoint overhead is shown at the initial fsync call after the xattr entry changes. Once the checkpoint is done, no additional overhead would be occurred. Signed-off-by: Jaegeuk Kim --- fs/f2fs/xattr.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/f2fs/xattr.c') diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 3ab07ecd86ca..0f6d2a1b9a7a 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -486,6 +486,10 @@ int f2fs_setxattr(struct inode *inode, int name_index, const char *name, inode->i_ctime = CURRENT_TIME; clear_inode_flag(fi, FI_ACL_MODE); } + + /* store checkpoint version for conducting checkpoint during fsync */ + fi->xattr_ver = le64_to_cpu(F2FS_CKPT(sbi)->checkpoint_ver); + if (ipage) update_inode(inode, ipage); else -- cgit