allocator: Fix find_free() returning a block past the end when full #125

Merged
vitalif merged 1 commits from koolkhel/vitastor:allocator-full-small into master 2026-11-17 23:37:01 +03:00

1 Commits

Author SHA1 Message Date
72242d312f allocator: Fix find_free() returning a block past the end when full
An allocator of 2-63 blocks has a single-level mask with no parent bit
to mark it full, and the mask bits past the end are always zero. So
find_free() on a full allocator returned the first index past the end
instead of UINT64_MAX. Store v1 then submitted a big write past the end
of its data area (the bounds assert in dequeue_write() fires) instead
of failing it with ENOSPC. Store v2 and vitastor-disk raw-resize use
the same call.

Check the leaf index against the allocator size, and cover sizes 2, 63
and 64 in test_allocator.
2026-11-17 21:12:58 +03:00