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>
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index b278bfb..67e2d13 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -346,8 +346,14 @@
 
 	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: