Commit ab126cfc authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: should get a victim from retrials

If we do not call get_victim first, we cannot get a new victim for retrial
path.
Reviewed-by: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 45fe8492
...@@ -799,8 +799,7 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, unsigned int segno, ...@@ -799,8 +799,7 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, unsigned int segno,
int f2fs_gc(struct f2fs_sb_info *sbi) int f2fs_gc(struct f2fs_sb_info *sbi)
{ {
unsigned int segno = NULL_SEGNO; unsigned int segno, i;
unsigned int i;
int gc_type = BG_GC; int gc_type = BG_GC;
int sec_freed = 0; int sec_freed = 0;
int ret = -1; int ret = -1;
...@@ -812,6 +811,8 @@ int f2fs_gc(struct f2fs_sb_info *sbi) ...@@ -812,6 +811,8 @@ int f2fs_gc(struct f2fs_sb_info *sbi)
cpc.reason = __get_cp_reason(sbi); cpc.reason = __get_cp_reason(sbi);
gc_more: gc_more:
segno = NULL_SEGNO;
if (unlikely(!(sbi->sb->s_flags & MS_ACTIVE))) if (unlikely(!(sbi->sb->s_flags & MS_ACTIVE)))
goto stop; goto stop;
if (unlikely(f2fs_cp_error(sbi))) if (unlikely(f2fs_cp_error(sbi)))
......
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