Skip to contentSkip to conversation

Revert "f2fs: add timeout in f2fs_enable_checkpoint()"

PATCH Applied Jaegeuk Kim 3 participants 3 messages Jan 16 – Jan 22 F2FS file system

lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 Revert "f2fs: add timeout in f2fs_enable_checkpoint()"

This reverts commit 4bc347779698b5e67e1514bab105c2c083e55502.

For stability, let's keep flushing all the data.

Fixes 4bc347779698 (f2fs: add timeout in f2fs_enable_checkpoint()")
---
 fs/f2fs/f2fs.h  |  2 --
 fs/f2fs/super.c | 15 ++++-----------
 2 files changed, 4 insertions(+), 13 deletions(-)
fs/f2fs/f2fs.h +0 -2
index 90aa1d53722a..8c256fcdcf5b 100644
@@ -311,7 +311,6 @@ enum {
 #define DEF_CP_INTERVAL			60	/* 60 secs */
 #define DEF_IDLE_INTERVAL		5	/* 5 secs */
 #define DEF_DISABLE_INTERVAL		5	/* 5 secs */
-#define DEF_ENABLE_INTERVAL		16	/* 16 secs */
 #define DEF_DISABLE_QUICK_INTERVAL	1	/* 1 secs */
 #define DEF_UMOUNT_DISCARD_TIMEOUT	5	/* 5 secs */
 
@@ -1482,7 +1481,6 @@ enum {
 	DISCARD_TIME,
 	GC_TIME,
 	DISABLE_TIME,
-	ENABLE_TIME,
 	UMOUNT_DISCARD_TIMEOUT,
 	MAX_TIME,
 };
fs/f2fs/super.c +4 -11
index 25f796232ad9..4869145531cc 100644
@@ -2686,7 +2686,7 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
 
 static int f2fs_enable_checkpoint(struct f2fs_sb_info *sbi)
 {
-	unsigned int nr_pages = get_pages(sbi, F2FS_DIRTY_DATA) / 16;
+	int retry = DEFAULT_RETRY_IO_COUNT;
 	long long start, writeback, end;
 	int ret;
 	struct f2fs_lock_context lc;
@@ -2696,22 +2696,16 @@ static int f2fs_enable_checkpoint(struct f2fs_sb_info *sbi)
 					get_pages(sbi, F2FS_DIRTY_NODES),
 					get_pages(sbi, F2FS_DIRTY_DATA));
 
-	f2fs_update_time(sbi, ENABLE_TIME);
-
 	start = ktime_get();
 
 	/* we should flush all the data to keep data consistency */
-	while (get_pages(sbi, F2FS_DIRTY_DATA)) {
-		writeback_inodes_sb_nr(sbi->sb, nr_pages, WB_REASON_SYNC);
+	do {
+		sync_inodes_sb(sbi->sb);
 		f2fs_io_schedule_timeout(DEFAULT_SCHEDULE_TIMEOUT);
+	} while (get_pages(sbi, F2FS_DIRTY_DATA) && retry--);
 
-		if (f2fs_time_over(sbi, ENABLE_TIME))
-			break;
-	}
 	writeback = ktime_get();
 
-	sync_inodes_sb(sbi->sb);
-
 	if (unlikely(get_pages(sbi, F2FS_DIRTY_DATA)))
 		f2fs_warn(sbi, "checkpoint=enable has some unwritten data: %lld",
 					get_pages(sbi, F2FS_DIRTY_DATA));
@@ -4335,7 +4329,6 @@ static void init_sb_info(struct f2fs_sb_info *sbi)
 	sbi->interval_time[DISCARD_TIME] = DEF_IDLE_INTERVAL;
 	sbi->interval_time[GC_TIME] = DEF_IDLE_INTERVAL;
 	sbi->interval_time[DISABLE_TIME] = DEF_DISABLE_INTERVAL;
-	sbi->interval_time[ENABLE_TIME] = DEF_ENABLE_INTERVAL;
 	sbi->interval_time[UMOUNT_DISCARD_TIMEOUT] =
 				DEF_UMOUNT_DISCARD_TIMEOUT;
 	clear_sbi_flag(sbi, SBI_NEED_FSCK);
Signature · 1 line
2.52.0.457.g6b5491de43-goog
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · On 1/17/2026 5:50 AM, Jaegeuk Kim via Linux-f2fs-devel wrote:

This reverts commit 4bc347779698b5e67e1514bab105c2c083e55502.

For stability, let's keep flushing all the data.

Fixes 4bc347779698 (f2fs: add timeout in f2fs_enable_checkpoint()")

We don't need to add Cc stable and Fixes line due to there is no regression issue, meanwhile it needs to change commit message a bit.

Otherwise, it looks good to me.

Thanks,

Quoted 73 lines
---
  fs/f2fs/f2fs.h  |  2 --
  fs/f2fs/super.c | 15 ++++-----------
  2 files changed, 4 insertions(+), 13 deletions(-)
fs/f2fs/f2fs.h +0 -2
index 90aa1d53722a..8c256fcdcf5b 100644
@@ -311,7 +311,6 @@ enum {
  #define DEF_CP_INTERVAL			60	/* 60 secs */
  #define DEF_IDLE_INTERVAL		5	/* 5 secs */
  #define DEF_DISABLE_INTERVAL		5	/* 5 secs */
-#define DEF_ENABLE_INTERVAL		16	/* 16 secs */
  #define DEF_DISABLE_QUICK_INTERVAL	1	/* 1 secs */
  #define DEF_UMOUNT_DISCARD_TIMEOUT	5	/* 5 secs */
 
@@ -1482,7 +1481,6 @@ enum {
  	DISCARD_TIME,
  	GC_TIME,
  	DISABLE_TIME,
-	ENABLE_TIME,
  	UMOUNT_DISCARD_TIMEOUT,
  	MAX_TIME,
  };
fs/f2fs/super.c +4 -11
index 25f796232ad9..4869145531cc 100644
@@ -2686,7 +2686,7 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
 
  static int f2fs_enable_checkpoint(struct f2fs_sb_info *sbi)
  {
-	unsigned int nr_pages = get_pages(sbi, F2FS_DIRTY_DATA) / 16;
+	int retry = DEFAULT_RETRY_IO_COUNT;
  	long long start, writeback, end;
  	int ret;
  	struct f2fs_lock_context lc;
@@ -2696,22 +2696,16 @@ static int f2fs_enable_checkpoint(struct f2fs_sb_info *sbi)
  					get_pages(sbi, F2FS_DIRTY_NODES),
  					get_pages(sbi, F2FS_DIRTY_DATA));
 
-	f2fs_update_time(sbi, ENABLE_TIME);
-
  	start = ktime_get();
 
  	/* we should flush all the data to keep data consistency */
-	while (get_pages(sbi, F2FS_DIRTY_DATA)) {
-		writeback_inodes_sb_nr(sbi->sb, nr_pages, WB_REASON_SYNC);
+	do {
+		sync_inodes_sb(sbi->sb);
  		f2fs_io_schedule_timeout(DEFAULT_SCHEDULE_TIMEOUT);
+	} while (get_pages(sbi, F2FS_DIRTY_DATA) && retry--);
 
-		if (f2fs_time_over(sbi, ENABLE_TIME))
-			break;
-	}
  	writeback = ktime_get();
 
-	sync_inodes_sb(sbi->sb);
-
  	if (unlikely(get_pages(sbi, F2FS_DIRTY_DATA)))
  		f2fs_warn(sbi, "checkpoint=enable has some unwritten data: %lld",
  					get_pages(sbi, F2FS_DIRTY_DATA));
@@ -4335,7 +4329,6 @@ static void init_sb_info(struct f2fs_sb_info *sbi)
  	sbi->interval_time[DISCARD_TIME] = DEF_IDLE_INTERVAL;
  	sbi->interval_time[GC_TIME] = DEF_IDLE_INTERVAL;
  	sbi->interval_time[DISABLE_TIME] = DEF_DISABLE_INTERVAL;
-	sbi->interval_time[ENABLE_TIME] = DEF_ENABLE_INTERVAL;
  	sbi->interval_time[UMOUNT_DISCARD_TIMEOUT] =
  				DEF_UMOUNT_DISCARD_TIMEOUT;
  	clear_sbi_flag(sbi, SBI_NEED_FSCK);
#2 lore raw
In reply to Jaegeuk Kim
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 9 lines · On Fri, 16 Jan 2026 21:50:44 +0000 you wrote:

This reverts commit 4bc347779698b5e67e1514bab105c2c083e55502.

For stability, let's keep flushing all the data.

Fixes 4bc347779698 (f2fs: add timeout in f2fs_enable_checkpoint()")

[...]

Here is the summary with links:
- [f2fs-dev] Revert "f2fs: add timeout in f2fs_enable_checkpoint()"

    https://git.kernel.org/jaegeuk/f2fs/c/993663874be5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html