f2fs: call mark_inode_dirty_sync for i_field changes
This patch calls mark_inode_dirty_sync() for the following on-disk inode
changes.
-> largest
-> ctime/mtime/atime
-> i_current_depth
-> i_xattr_nid
-> i_pino
-> i_advise
-> i_flags
-> i_mode
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 7a9bc44..4bc025c 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -400,7 +400,7 @@
stat_dec_inline_dir(dir);
clear_inode_flag(dir, FI_INLINE_DENTRY);
- F2FS_I(dir)->i_current_depth = 1;
+ f2fs_i_depth_write(dir, 1);
if (i_size_read(dir) < PAGE_SIZE) {
f2fs_i_size_write(dir, PAGE_SIZE);
set_inode_flag(dir, FI_UPDATE_DIR);
@@ -492,7 +492,7 @@
recover:
lock_page(ipage);
memcpy(inline_dentry, backup_dentry, MAX_INLINE_DATA);
- F2FS_I(dir)->i_current_depth = 0;
+ f2fs_i_depth_write(dir, 0);
f2fs_i_size_write(dir, MAX_INLINE_DATA);
update_inode(dir, ipage);
f2fs_put_page(ipage, 1);
@@ -558,7 +558,7 @@
/* we don't need to mark_inode_dirty now */
if (inode) {
- F2FS_I(inode)->i_pino = dir->i_ino;
+ f2fs_i_pino_write(inode, dir->i_ino);
update_inode(inode, page);
f2fs_put_page(page, 1);
}
@@ -597,6 +597,7 @@
set_page_dirty(page);
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
+ mark_inode_dirty_sync(dir);
if (inode)
f2fs_drop_nlink(dir, inode, page);