summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/dir.c
diff options
context:
space:
mode:
authorJaegeuk Kim2013-05-28 05:25:47 +0200
committerJaegeuk Kim2013-05-28 08:03:06 +0200
commit83d5d6f66b375f21bee4c2e17178f7c073a66301 (patch)
tree1373f4abee6f281933f9e7fee9dfa5cb3d831f7c /fs/f2fs/dir.c
parentf2fs: fix incorrect iputs during the dentry recovery (diff)
downloadkernel-qcow2-linux-83d5d6f66b375f21bee4c2e17178f7c073a66301.tar.gz
kernel-qcow2-linux-83d5d6f66b375f21bee4c2e17178f7c073a66301.tar.xz
kernel-qcow2-linux-83d5d6f66b375f21bee4c2e17178f7c073a66301.zip
f2fs: cover cp_file information with ilock
If a file is linked with other files, it should be checkpointed at every fsync calls. For this, we use set_cp_file() with FADVISE_CP_BIT, but previously we didn't cover the flag by the global lock. This patch fixes that the inode page stores this correctly. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r--fs/f2fs/dir.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index b278bfbc3646..67e2d1361fa2 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -346,8 +346,14 @@ static struct page *init_inode_metadata(struct inode *inode,
init_dent_inode(name, page);
- if (is_inode_flag_set(F2FS_I(inode), FI_INC_LINK))
+ /*
+ * This file should be checkpointed during fsync.
+ * We lost i_pino from now on.
+ */
+ if (is_inode_flag_set(F2FS_I(inode), FI_INC_LINK)) {
+ set_cp_file(inode);
inc_nlink(inode);
+ }
return page;
error: