All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: prevent the current section from being selected as a victim during garbage collection
@ 2025-03-26 14:14 ` Yohan Joung
  0 siblings, 0 replies; 34+ messages in thread
From: Yohan Joung @ 2025-03-26 14:14 UTC (permalink / raw)
  To: jaegeuk, chao, daeho43; +Cc: linux-kernel, linux-f2fs-devel

When selecting a victim using next_victim_seg in a large section, the
selected section might already have been cleared and designated as the
new current section, making it actively in use.
This behavior causes inconsistency between the SIT and SSA.

Signed-off-by: Yohan Joung <yohan.joung@sk.com>
---
 fs/f2fs/gc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 2b8f9239bede..4b5d18e395eb 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1926,6 +1926,10 @@ int f2fs_gc(struct f2fs_sb_info *sbi, struct f2fs_gc_control *gc_control)
 		goto stop;
 	}
 
+	if (__is_large_section(sbi) &&
+			IS_CURSEC(sbi, GET_SEC_FROM_SEG(sbi, segno)))
+		goto stop;
+
 	seg_freed = do_garbage_collect(sbi, segno, &gc_list, gc_type,
 				gc_control->should_migrate_blocks,
 				gc_control->one_time);
-- 
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2025-04-02  0:34 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 14:14 [f2fs-dev] [PATCH] f2fs: prevent the current section from being selected as a victim during garbage collection Yohan Joung
2025-03-26 14:14 ` Yohan Joung
2025-03-27  6:02 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-03-27  6:02   ` Chao Yu
2025-03-27  6:43   ` [f2fs-dev] [External Mail] " yohan.joung
2025-03-27  6:43     ` 정요한(JOUNG YOHAN) Mobile AE
2025-03-27  7:29     ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-03-27  7:29       ` Chao Yu
2025-03-27  8:00       ` [f2fs-dev] [External Mail] " yohan.joung
2025-03-27  8:00         ` 정요한(JOUNG YOHAN) Mobile AE
2025-03-27 13:47         ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-03-27 13:47           ` Chao Yu
2025-03-28  3:40           ` [f2fs-dev] " yohan.joung
2025-03-28  3:40             ` yohan.joung
2025-03-28  6:17             ` Chao Yu via Linux-f2fs-devel
2025-03-28  6:17               ` Chao Yu
2025-03-28  7:25               ` [f2fs-dev] [External Mail] " yohan.joung
2025-03-28  7:25                 ` [External Mail] Re: [f2fs-dev] " yohan.joung
2025-03-28  8:00                 ` [f2fs-dev] [External Mail] " Chao Yu via Linux-f2fs-devel
2025-03-28  8:00                   ` [External Mail] Re: [f2fs-dev] " Chao Yu
2025-03-31  5:13                   ` [f2fs-dev] [External Mail] " yohan.joung
2025-03-31  5:13                     ` [External Mail] Re: [f2fs-dev] " yohan.joung
2025-03-31 11:36                     ` [f2fs-dev] [External Mail] " Chao Yu via Linux-f2fs-devel
2025-03-31 11:36                       ` [External Mail] Re: [f2fs-dev] " Chao Yu
2025-04-01  1:51                   ` [f2fs-dev] [External Mail] " yohan.joung
2025-04-01  1:51                     ` [External Mail] Re: [f2fs-dev] " yohan.joung
2025-04-01  5:41                     ` [f2fs-dev] [External Mail] " Chao Yu via Linux-f2fs-devel
2025-04-01  5:41                       ` [External Mail] Re: [f2fs-dev] " Chao Yu
2025-04-01  7:47                       ` [f2fs-dev] [External Mail] " yohan.joung
2025-04-01  7:47                         ` [External Mail] Re: [f2fs-dev] " yohan.joung
2025-04-01  8:44                         ` [f2fs-dev] [External Mail] " Chao Yu via Linux-f2fs-devel
2025-04-01  8:44                           ` [External Mail] Re: [f2fs-dev] " Chao Yu
2025-04-02  0:33                           ` [f2fs-dev] [External Mail] " yohan.joung
2025-04-02  0:33                             ` [External Mail] Re: [f2fs-dev] " yohan.joung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.