diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-09-19 03:33:00 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-10-10 02:20:55 +0300 |
commit | ab126cfc3090fa5af2a87cc0698f793aebbec7d0 (patch) | |
tree | 4bc9bdc68bb8913c44ea6543905150e488dff424 | |
parent | 45fe8492ccbe561c4b8918c2d4c83a0501e50646 (diff) | |
download | linux-ab126cfc3090fa5af2a87cc0698f793aebbec7d0.tar.xz |
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: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fs/f2fs/gc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index b6e03ebc703c..343b096cb654 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -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) { - unsigned int segno = NULL_SEGNO; - unsigned int i; + unsigned int segno, i; int gc_type = BG_GC; int sec_freed = 0; int ret = -1; @@ -812,6 +811,8 @@ int f2fs_gc(struct f2fs_sb_info *sbi) cpc.reason = __get_cp_reason(sbi); gc_more: + segno = NULL_SEGNO; + if (unlikely(!(sbi->sb->s_flags & MS_ACTIVE))) goto stop; if (unlikely(f2fs_cp_error(sbi))) |