From fd0bb82b50a7e1c86ab098b01d1a44756b3ee56a Mon Sep 17 00:00:00 2001 From: James Matlik Date: Sun, 20 Apr 2025 17:43:08 -0400 Subject: [PATCH] Fix reset_allocator regression that incorrectly returns ENOSPC --- src/transaction.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/transaction.rs b/src/transaction.rs index 59360a396e..d06d0ff17e 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -119,7 +119,8 @@ impl<'a, D: Disk> Transaction<'a, D> { fn sync_allocator(&mut self, force_squash: bool) -> Result { let mut prev_ptr = BlockPtr::default(); let should_gc = self.header.generation() % ALLOC_GC_THRESHOLD == 0 - && self.header.generation() >= ALLOC_GC_THRESHOLD; + && self.header.generation() >= ALLOC_GC_THRESHOLD + && self.allocator.free() > 0; if force_squash || should_gc { // Clear and rebuild alloc log self.allocator_log.clear();