We should decrease the frozen counter.

Cc: [email protected]
Fixes: 325163e9892b ("f2fs: add gc_urgent_high_remaining sysfs node")
Signed-off-by: Jaegeuk Kim <[email protected]>
---

Change log from v1:
 - fix by refactoring the flow

 fs/f2fs/gc.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 6da21d405ce1..45f90e3c46d4 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -97,14 +97,10 @@ static int gc_thread_func(void *data)
                 */
                if (sbi->gc_mode == GC_URGENT_HIGH) {
                        spin_lock(&sbi->gc_urgent_high_lock);
-                       if (sbi->gc_urgent_high_limited) {
-                               if (!sbi->gc_urgent_high_remaining) {
-                                       sbi->gc_urgent_high_limited = false;
-                                       spin_unlock(&sbi->gc_urgent_high_lock);
-                                       sbi->gc_mode = GC_NORMAL;
-                                       continue;
-                               }
-                               sbi->gc_urgent_high_remaining--;
+                       if (sbi->gc_urgent_high_limited &&
+                                       !sbi->gc_urgent_high_remaining--) {
+                               sbi->gc_urgent_high_limited = false;
+                               sbi->gc_mode = GC_NORMAL;
                        }
                        spin_unlock(&sbi->gc_urgent_high_lock);
                }
-- 
2.37.1.595.g718a3a8f04-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to