All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 1/2] f2fs: flush SIT journal during filesystem resize
@ 2026-08-28 14:12 Wenjie Qi
  2026-08-28 14:12 ` [f2fs-dev] [PATCH 2/2] f2fs: refresh pinned allocation boundary after resize Wenjie Qi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Wenjie Qi @ 2026-08-28 14:12 UTC (permalink / raw)
  To: jaegeuk, chao
  Cc: daehojeong, qwjhust, linux-kernel, linux-f2fs-devel, qiwenjie,
	sunqiuyang

During a filesystem resize, SBI_IS_RESIZEFS prevents new SIT entries
from being added to the journal and forces existing entries to the SIT
area. However, f2fs_flush_sit_entries() returns early when there are no
new dirty sentries, leaving existing journal entries behind.

After the main area shrinks, a later checkpoint can access a journal
entry whose segment number is outside the new geometry and trigger
f2fs_bug_on().

Only take the zero-dirty fast path when entries may be written back to
the journal. This lets resize drain existing entries through
remove_sits_in_journal() even when there are no new dirty sentries.

Fixes: 04f0b2eaa3b3 ("f2fs: ioctl for removing a range from F2FS")
Signed-off-by: Wenjie Qi <qiwenjie@xiaomi.com>
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 1e7e745be71d..9f9ce25dd07e 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -4816,7 +4816,7 @@ void f2fs_flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
 
 	down_write(&sit_i->sentry_lock);
 
-	if (!sit_i->dirty_sentries)
+	if (!sit_i->dirty_sentries && to_journal)
 		goto out;
 
 	/*
-- 
2.43.0



_______________________________________________
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] 6+ messages in thread

end of thread, other threads:[~2026-10-19 15:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28 14:12 [f2fs-dev] [PATCH 1/2] f2fs: flush SIT journal during filesystem resize Wenjie Qi
2026-08-28 14:12 ` [f2fs-dev] [PATCH 2/2] f2fs: refresh pinned allocation boundary after resize Wenjie Qi
2026-08-28 18:08   ` Daeho Jeong
2026-08-29  6:07     ` Wenjie Qi
2026-09-24 15:57 ` [f2fs-dev] [PATCH 1/2] f2fs: flush SIT journal during filesystem resize Daeho Jeong
2026-10-19 15:40 ` patchwork-bot+f2fs--- via Linux-f2fs-devel

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.