f2fs: fix iget/iput of dir during recovery

It is possible that iput is skipped after iget during the recovery.

In recover_dentry(),
 dir = f2fs_iget();
 ...
 if (de && inode->i_ino == le32_to_cpu(de->ino))
	goto out;

In this case, this dir is not able to be added in dirty_dir_inode_list.
The actual linking is done only when set_page_dirty() is called.

So let's add this newly got inode into the list explicitly, and put it at the
end of the recovery routine.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
This commit is contained in:
Jaegeuk Kim
2013-06-05 17:42:45 +09:00
parent b2b3460a94
commit 5deb82671a
3 changed files with 41 additions and 16 deletions

View File

@@ -58,6 +58,7 @@ static int recover_dentry(struct page *ipage, struct inode *inode)
goto out;
}
set_inode_flag(F2FS_I(dir), FI_DELAY_IPUT);
add_dirty_dir_inode(dir);
}
name.len = le32_to_cpu(raw_inode->i_namelen);