From 92620d386f20531d66dec54378deeba0e0844e72 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sat, 4 Oct 2025 12:12:29 -0500 Subject: [PATCH] bmap: Recheckpoint the allocator after rebuilding the bmap If before rebuilding the bmap is a valid checkpoint, after is too. This lets us realloc any blocks that may have been temporarily allocated when rebuilding the bmap. This probably doesn't matter much except for low-storage states when blocks are extremely scarce, but allocator checkpoints are cheap so better safe than sorry. Code changes minimal (negative?): code stack ctx before: 37172 2352 684 after: 37172 (+0.0%) 2352 (+0.0%) 684 (+0.0%) code stack ctx bmap before: 38852 2456 800 bmap after: 38844 (-0.0%) 2456 (+0.0%) 800 (+0.0%) --- lfs3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lfs3.c b/lfs3.c index be90dd8a..c3e7c915 100644 --- a/lfs3.c +++ b/lfs3.c @@ -11018,6 +11018,9 @@ static inline int lfs3_alloc_ckpoint(lfs3_t *lfs3) { if (err) { return err; } + + // checkpoint the allocator again + lfs3->lookahead.ckpoint = lfs3->block_count; } #endif return 0;