Commit 4eea93e3 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: run fsck when getting bad inode during GC

This is to avoid inifinite GC when trying to disable checkpoint.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 4c8ff709
......@@ -1049,8 +1049,10 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
if (phase == 3) {
inode = f2fs_iget(sb, dni.ino);
if (IS_ERR(inode) || is_bad_inode(inode))
if (IS_ERR(inode) || is_bad_inode(inode)) {
set_sbi_flag(sbi, SBI_NEED_FSCK);
continue;
}
if (!down_write_trylock(
&F2FS_I(inode)->i_gc_rwsem[WRITE])) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment