--- x/fs/f2fs/gc.c +++ y/fs/f2fs/gc.c @@ -955,7 +955,8 @@ static int check_valid_map(struct f2fs_s struct seg_entry *sentry; int ret; - down_read(&sit_i->sentry_lock); + if (!down_read_trylock(&sit_i->sentry_lock)) + return 0; sentry = get_seg_entry(sbi, segno); ret = f2fs_test_bit(offset, sentry->cur_valid_map); up_read(&sit_i->sentry_lock); @@ -1813,8 +1814,6 @@ gc_more: if (ret) goto stop; } - if (has_not_enough_free_secs(sbi, 0, 0)) - gc_type = FG_GC; } /* f2fs_balance_fs doesn't need to do BG_GC in critical path. */