summaryrefslogtreecommitdiff
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2019-12-20 17:20:05 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2020-01-17 16:48:42 -0800
commit4eea93e3ff98aa185302d562f0df1ad501c51e70 (patch)
tree5520cb0d63657e3eb6dc2b0064d5ea61df65feb4 /fs/f2fs/gc.c
parent4c8ff7095bef64fc47e996a938f7d57f9e077da3 (diff)
f2fs: run fsck when getting bad inode during GC
This is to avoid inifinite GC when trying to disable checkpoint. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index b3d399623290..c43181ef98c4 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1049,8 +1049,10 @@ next_step:
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])) {