Skip to contentSkip to conversation

f2fs: fix CURSEG_HOT_DATA left space check

PATCH Superseded mason.zhang 1 participant 1 message Aug 4, 2025 F2FS file system

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: fix CURSEG_HOT_DATA left space check

This fix combines the space check for data_blocks and dent_blocks when verifying HOT_DATA segment capacity, preventing potential insufficient space issues during checkpoint.

---
 fs/f2fs/segment.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/segment.h +1 -1
index db619fd2f51a..d8dae0049b6a 100644
@@ -649,7 +649,7 @@ static inline bool has_curseg_enough_space(struct f2fs_sb_info *sbi,
 				get_ckpt_valid_blocks(sbi, segno, true);
 	}
 
-	if (dent_blocks > left_blocks)
+	if (dent_blocks + data_blocks > left_blocks)
 		return false;
 	return true;
 }
Signature · 1 line
2.48.1