Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f2fs: fix wrong continue condition in GC

We should decrease the frozen counter.

Cc: stable@vger.kernel.org
Fixes: 325163e9892b ("f2fs: add gc_urgent_high_remaining sysfs node")
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

+4 -8
+4 -8
fs/f2fs/gc.c
··· 97 97 */ 98 98 if (sbi->gc_mode == GC_URGENT_HIGH) { 99 99 spin_lock(&sbi->gc_urgent_high_lock); 100 - if (sbi->gc_urgent_high_limited) { 101 - if (!sbi->gc_urgent_high_remaining) { 102 - sbi->gc_urgent_high_limited = false; 103 - spin_unlock(&sbi->gc_urgent_high_lock); 104 - sbi->gc_mode = GC_NORMAL; 105 - continue; 106 - } 107 - sbi->gc_urgent_high_remaining--; 100 + if (sbi->gc_urgent_high_limited && 101 + !sbi->gc_urgent_high_remaining--) { 102 + sbi->gc_urgent_high_limited = false; 103 + sbi->gc_mode = GC_NORMAL; 108 104 } 109 105 spin_unlock(&sbi->gc_urgent_high_lock); 110 106 }