summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2026-05-11 00:30:33 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2026-06-22 19:52:34 +0000
commit47a60629caca7ea6475deb21d16112b35645b59f (patch)
tree1dfd05e2100f0e559c4ef6d72a32dbd67f779fb0
parentcaac757a3d2dddeb88d79a7524ca0033fc337b3d (diff)
f2fs: add logs in f2fs_disable_checkpoint()
In order to troubleshoot in which step we may block on during mount w/ checkpoint_disable mount option. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/super.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index f4ab39b24a30..629548d78db0 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2633,6 +2633,9 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
/* check if we need more GC first */
unusable = f2fs_get_unusable_blocks(sbi);
+
+ f2fs_info(sbi, "%s starts, unusable: %u", __func__, unusable);
+
if (!f2fs_disable_cp_again(sbi, unusable))
goto skip_gc;
@@ -2640,6 +2643,8 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
sbi->gc_mode = GC_URGENT_HIGH;
+ f2fs_info(sbi, "%s: run f2fs_gc() to migrate blocks", __func__);
+
while (!f2fs_time_over(sbi, DISABLE_TIME)) {
struct f2fs_gc_control gc_control = {
.victim_segno = NULL_SEGNO,
@@ -2660,6 +2665,12 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
break;
}
+ f2fs_info(sbi, "%s: call sync_filesystem() to persist meta: %lld, node: %lld, data: %lld",
+ __func__,
+ get_pages(sbi, F2FS_DIRTY_META),
+ get_pages(sbi, F2FS_DIRTY_NODES),
+ get_pages(sbi, F2FS_DIRTY_DATA));
+
ret = sync_filesystem(sbi->sb);
if (ret || err) {
err = ret ? ret : err;
@@ -2673,6 +2684,12 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
}
skip_gc:
+ f2fs_info(sbi, "%s: call f2fs_write_checkpoint(), meta: %lld, node: %lld, data: %lld",
+ __func__,
+ get_pages(sbi, F2FS_DIRTY_META),
+ get_pages(sbi, F2FS_DIRTY_NODES),
+ get_pages(sbi, F2FS_DIRTY_DATA));
+
f2fs_down_write_trace(&sbi->gc_lock, &lc);
cpc.reason = CP_PAUSE;
set_sbi_flag(sbi, SBI_CP_DISABLED);
@@ -2690,7 +2707,7 @@ out_unlock:
restore_flag:
sbi->gc_mode = gc_mode;
sbi->sb->s_flags = s_flags; /* Restore SB_RDONLY status */
- f2fs_info(sbi, "f2fs_disable_checkpoint() finish, err:%d", err);
+ f2fs_info(sbi, "%s finishes, err:%d", __func__, err);
return err;
}