Revert "f2fs: add timeout in f2fs_enable_checkpoint()"
Jaegeuk Kim
maintainerPATCH 1/1 Revert "f2fs: add timeout in f2fs_enable_checkpoint()"
This reverts commit 4bc347779698b5e67e1514bab105c2c083e55502.
For stability, let's keep flushing all the data.
--- fs/f2fs/f2fs.h | 2 -- fs/f2fs/super.c | 15 ++++----------- 2 files changed, 4 insertions(+), 13 deletions(-)
fs/f2fs/f2fs.h +0 -2
@@ -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
@@ -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
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
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/f2fs.h | 2 -- fs/f2fs/super.c | 15 ++++----------- 2 files changed, 4 insertions(+), 13 deletions(-)fs/f2fs/f2fs.h +0
-2@@ -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@@ -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 );
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()")Signed-off-by Jaegeuk Kim <[email protected]>[...]
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