lkml.org 
[lkml]   [2022]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [f2fs-dev] [PATCH] f2fs: fix wrong continue condition in GC
On 08/15, Chao Yu wrote:
> On 2022/8/13 22:37, Jaegeuk Kim wrote:
> > We should decrease the frozen counter.
> >
> > Cc: stable@kernel.org
> > Fixes: 325163e9892b ("f2fs: add gc_urgent_high_remaining sysfs node")
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> > fs/f2fs/gc.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> > index 6da21d405ce1..7e4b41240d59 100644
> > --- a/fs/f2fs/gc.c
> > +++ b/fs/f2fs/gc.c
> > @@ -102,7 +102,7 @@ static int gc_thread_func(void *data)
> > sbi->gc_urgent_high_limited = false;
> > spin_unlock(&sbi->gc_urgent_high_lock);
> > sbi->gc_mode = GC_NORMAL;
> > - continue;
> > + goto next;
> > }
> > sbi->gc_urgent_high_remaining--;
> > }
>
> Why not:
>
> if (!sbi->gc_urgent_high_remaining) {
> sbi->gc_urgent_high_limited = false;
> spin_unlock(&sbi->gc_urgent_high_lock);

Should not call spin_unlock, if so. Anyway, let me send v2.

> sbi->gc_mode = GC_NORMAL;
> } else {
> sbi->gc_urgent_high_remaining--;
> }
>
> Thanks,

\
 
 \ /
  Last update: 2022-08-20 01:35    [W:0.058 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site