aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-05-27 23:25:47 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-05-28 02:03:06 -0400
commit83d5d6f66b375f21bee4c2e17178f7c073a66301 (patch)
tree1373f4abee6f281933f9e7fee9dfa5cb3d831f7c
parentafc3eda2a897b402e59f42f22eb89bba52297dd3 (diff)
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 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,
346 346
347 init_dent_inode(name, page); 347 init_dent_inode(name, page);
348 348
349 if (is_inode_flag_set(F2FS_I(inode), FI_INC_LINK)) 349 /*
350 * This file should be checkpointed during fsync.
351 * We lost i_pino from now on.
352 */
353 if (is_inode_flag_set(F2FS_I(inode), FI_INC_LINK)) {
354 set_cp_file(inode);
350 inc_nlink(inode); 355 inc_nlink(inode);
356 }
351 return page; 357 return page;
352 358
353error: 359error:
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index efe0a127cb76..1fe150276fad 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,
181 if (err) 181 if (err)
182 goto out; 182 goto out;
183 183
184 /*
185 * This file should be checkpointed during fsync.
186 * We lost i_pino from now on.
187 */
188 set_cp_file(inode);
189
190 d_instantiate(dentry, inode); 184 d_instantiate(dentry, inode);
191 return 0; 185 return 0;
192out: 186out: