Skip to contentSkip to conversation

f2fs: check free sections before disable checkpoint

PATCH Applied Wu Bo 3 participants 3 messages Dec 29, 2023 – Jan 29, 2024 F2FS file system

lore
Share & tools
lore

Wu Bo

author
#0 lore raw

PATCH 1/1 f2fs: check free sections before disable checkpoint

'f2fs_is_checkpoint_ready()' checks free sections. If there is not enough free sections, most f2fs operations will return -ENOSPC when checkpoint is disabled.

It would be better to check free sections before disable checkpoint.

---
 fs/f2fs/segment.c | 2 ++
 1 file changed, 2 insertions(+)
fs/f2fs/segment.c +2 -0
index 727d016318f9..8f8c0bb75be1 100644
@@ -906,6 +906,8 @@ int f2fs_disable_cp_again(struct f2fs_sb_info *sbi, block_t unusable)
 	if (is_sbi_flag_set(sbi, SBI_CP_DISABLED_QUICK) &&
 		dirty_segments(sbi) > ovp_hole_segs)
 		return -EAGAIN;
+	if (has_not_enough_free_secs(sbi, 0, 0))
+		return -EAGAIN;
 	return 0;
 }
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Wu Bo

'f2fs_is_checkpoint_ready()' checks free sections. If there is not enough free sections, most f2fs operations will return -ENOSPC when checkpoint is disabled.

It would be better to check free sections before disable checkpoint.

Thanks,

#2 lore raw
In reply to Wu Bo
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 Thu, 28 Dec 2023 20:25:07 -0700 you wrote:

'f2fs_is_checkpoint_ready()' checks free sections. If there is not enough free sections, most f2fs operations will return -ENOSPC when checkpoint is disabled.

It would be better to check free sections before disable checkpoint.

[...]

Here is the summary with links:
- [f2fs-dev] f2fs: check free sections before disable checkpoint

    https://git.kernel.org/jaegeuk/f2fs/c/e2f29120ff1f

You are awesome, thank you!

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