summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/dir.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2014-01-21 13:32:12 +0900
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-01-22 18:40:34 +0900
commita18ff063406dd6aec41fda598eabe2691007a30d (patch)
treee38d3496b818e75bde2cbb18c949efb8e906c713 /fs/f2fs/dir.c
parent6c311ec6c2d9e015d454b4e3fda8008b5bebf316 (diff)
downloadop-kernel-dev-a18ff063406dd6aec41fda598eabe2691007a30d.zip
op-kernel-dev-a18ff063406dd6aec41fda598eabe2691007a30d.tar.gz
f2fs: call mark_inode_dirty to flush dirty pages
If a dentry page is updated, we should call mark_inode_dirty to add the inode into the dirty list, so that its dentry pages are flushed to the disk. Otherwise, the inode can be evicted without flush. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r--fs/f2fs/dir.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index cd055b6..b2b77cc 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -388,6 +388,8 @@ static void update_parent_metadata(struct inode *dir, struct inode *inode,
clear_inode_flag(F2FS_I(inode), FI_NEW_INODE);
}
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
+ mark_inode_dirty(dir);
+
if (F2FS_I(dir)->i_current_depth != current_depth) {
F2FS_I(dir)->i_current_depth = current_depth;
set_inode_flag(F2FS_I(dir), FI_UPDATE_DIR);
@@ -395,8 +397,6 @@ static void update_parent_metadata(struct inode *dir, struct inode *inode,
if (is_inode_flag_set(F2FS_I(dir), FI_UPDATE_DIR))
update_inode_page(dir);
- else
- mark_inode_dirty(dir);
if (is_inode_flag_set(F2FS_I(inode), FI_INC_LINK))
clear_inode_flag(F2FS_I(inode), FI_INC_LINK);
@@ -553,8 +553,6 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page,
if (inode && S_ISDIR(inode->i_mode)) {
drop_nlink(dir);
update_inode_page(dir);
- } else {
- mark_inode_dirty(dir);
}
if (inode) {
OpenPOWER on IntegriCloud