Skip to content

Commit

Permalink
f2fs: iput only if whole data blocks are flushed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jaegeuk Kim committed May 28, 2013
1 parent 7a267f8 commit 3b10b1f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/f2fs/checkpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,10 @@ void remove_dirty_dir_inode(struct inode *inode)
return;

spin_lock(&sbi->dir_inode_lock);
if (atomic_read(&F2FS_I(inode)->dirty_dents))
goto out;
if (atomic_read(&F2FS_I(inode)->dirty_dents)) {
spin_unlock(&sbi->dir_inode_lock);
return;
}

list_for_each(this, head) {
struct dir_inode_entry *entry;
Expand All @@ -516,7 +518,6 @@ void remove_dirty_dir_inode(struct inode *inode)
break;
}
}
out:
spin_unlock(&sbi->dir_inode_lock);

/* Only from the recovery routine */
Expand Down

0 comments on commit 3b10b1f

Please sign in to comment.