aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-05-28 12:25:47 +0900
committerAndreas Blaesius <skate4life@gmx.de>2016-06-05 21:20:26 +0200
commiteec07b97aa11b9085fc9d72c2dfe1623b8782352 (patch)
treeac5cb3f22e4cd31b528ea45e49c6e5b55f26ca2c
parent3dec66bd086a1dffda4feadaae3be35e35cc6e62 (diff)
downloadkernel_samsung_espresso10-eec07b97aa11b9085fc9d72c2dfe1623b8782352.zip
kernel_samsung_espresso10-eec07b97aa11b9085fc9d72c2dfe1623b8782352.tar.gz
kernel_samsung_espresso10-eec07b97aa11b9085fc9d72c2dfe1623b8782352.tar.bz2
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>
-rw-r--r--fs/f2fs/dir.c8
-rw-r--r--fs/f2fs/namei.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 790a4b7..be36dd8 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:
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index aff53f5..a2b50cd 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -181,12 +181,6 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
if (err)
goto out;
- /*
- * This file should be checkpointed during fsync.
- * We lost i_pino from now on.
- */
- set_cp_file(inode);
-
d_instantiate(dentry, inode);
return 0;
out: