Merge branch 'Fix-reset_allocator-regression-incorrectly-returning-ENOSPC' into 'master'

Fix reset_allocator regression that incorrectly returns ENOSPC

See merge request redox-os/redoxfs!89
This commit is contained in:
Jeremy Soller
2025-04-20 21:54:10 +00:00
+2 -1
View File
@@ -119,7 +119,8 @@ impl<'a, D: Disk> Transaction<'a, D> {
fn sync_allocator(&mut self, force_squash: bool) -> Result<bool> {
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();