aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-05-26 21:32:01 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-05-28 02:03:05 -0400
commit3b10b1fd2b6bc82eeb346ff6a6621d065908ea6d (patch)
treed29a8041d0f71158e7a0a453e710216d73a8feaa /fs/f2fs/checkpoint.c
parent7a267f8d7463346a139e49c8beac1b8bfe32ef97 (diff)
f2fs: iput only if whole data blocks are flushed
If there remains some unwritten blocks from the recovery, we should not call iput on that directory inode. Otherwise, we can loose some dentry blocks after the recovery. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 01ddc911ac9b..0d3701dce462 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -501,8 +501,10 @@ void remove_dirty_dir_inode(struct inode *inode)
501 return; 501 return;
502 502
503 spin_lock(&sbi->dir_inode_lock); 503 spin_lock(&sbi->dir_inode_lock);
504 if (atomic_read(&F2FS_I(inode)->dirty_dents)) 504 if (atomic_read(&F2FS_I(inode)->dirty_dents)) {
505 goto out; 505 spin_unlock(&sbi->dir_inode_lock);
506 return;
507 }
506 508
507 list_for_each(this, head) { 509 list_for_each(this, head) {
508 struct dir_inode_entry *entry; 510 struct dir_inode_entry *entry;
@@ -516,7 +518,6 @@ void remove_dirty_dir_inode(struct inode *inode)
516 break; 518 break;
517 } 519 }
518 } 520 }
519out:
520 spin_unlock(&sbi->dir_inode_lock); 521 spin_unlock(&sbi->dir_inode_lock);
521 522
522 /* Only from the recovery routine */ 523 /* Only from the recovery routine */