mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
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>
This commit is contained in:
parent
7a267f8d74
commit
3b10b1fd2b
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue