diff options
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/f2fs.h | 1 | ||||
-rw-r--r-- | fs/f2fs/file.c | 5 | ||||
-rw-r--r-- | fs/f2fs/xattr.c | 4 |
3 files changed, 10 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index eb8c45b65fe5..c1c9670e642f 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -181,6 +181,7 @@ struct f2fs_inode_info { | |||
181 | f2fs_hash_t chash; /* hash value of given file name */ | 181 | f2fs_hash_t chash; /* hash value of given file name */ |
182 | unsigned int clevel; /* maximum level of given file name */ | 182 | unsigned int clevel; /* maximum level of given file name */ |
183 | nid_t i_xattr_nid; /* node id that contains xattrs */ | 183 | nid_t i_xattr_nid; /* node id that contains xattrs */ |
184 | unsigned long long xattr_ver; /* cp version of xattr modification */ | ||
184 | struct extent_info ext; /* in-memory extent cache entry */ | 185 | struct extent_info ext; /* in-memory extent cache entry */ |
185 | }; | 186 | }; |
186 | 187 | ||
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index c2deb27ffb72..8ef3184b0037 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
@@ -161,10 +161,15 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) | |||
161 | need_cp = true; | 161 | need_cp = true; |
162 | else if (!is_checkpointed_node(sbi, F2FS_I(inode)->i_pino)) | 162 | else if (!is_checkpointed_node(sbi, F2FS_I(inode)->i_pino)) |
163 | need_cp = true; | 163 | need_cp = true; |
164 | else if (F2FS_I(inode)->xattr_ver == | ||
165 | le64_to_cpu(F2FS_CKPT(sbi)->checkpoint_ver)) | ||
166 | need_cp = true; | ||
164 | 167 | ||
165 | if (need_cp) { | 168 | if (need_cp) { |
166 | nid_t pino; | 169 | nid_t pino; |
167 | 170 | ||
171 | F2FS_I(inode)->xattr_ver = 0; | ||
172 | |||
168 | /* all the dirty node pages should be flushed for POR */ | 173 | /* all the dirty node pages should be flushed for POR */ |
169 | ret = f2fs_sync_fs(inode->i_sb, 1); | 174 | ret = f2fs_sync_fs(inode->i_sb, 1); |
170 | if (file_wrong_pino(inode) && inode->i_nlink == 1 && | 175 | if (file_wrong_pino(inode) && inode->i_nlink == 1 && |
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, | |||
486 | inode->i_ctime = CURRENT_TIME; | 486 | inode->i_ctime = CURRENT_TIME; |
487 | clear_inode_flag(fi, FI_ACL_MODE); | 487 | clear_inode_flag(fi, FI_ACL_MODE); |
488 | } | 488 | } |
489 | |||
490 | /* store checkpoint version for conducting checkpoint during fsync */ | ||
491 | fi->xattr_ver = le64_to_cpu(F2FS_CKPT(sbi)->checkpoint_ver); | ||
492 | |||
489 | if (ipage) | 493 | if (ipage) |
490 | update_inode(inode, ipage); | 494 | update_inode(inode, ipage); |
491 | else | 495 | else |