mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #217] [MERGED] fix(overlaybd): preallocate cache blocks to avoid SIGBUS when disk is… #258
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#258
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/217
Author: @huang-jl
Created: 8/25/2026
Status: ✅ Merged
Merged: 8/26/2026
Merged by: @yingdi-shan
Base:
main← Head:hjl/fix-cache-sigbus📝 Commits (1)
80e6470fix(overlaybd): preallocate cache blocks to avoid SIGBUS when disk is full📊 Changes
3 files changed (+254 additions, -7 deletions)
View changed files
📝
storage/overlaybd/src/backend/cache/full_file_cache/cache_entry.rs(+135 -0)📝
storage/overlaybd/src/backend/cache/full_file_cache/cache_store.rs(+22 -7)📝
storage/overlaybd/src/backend/cache/tests.rs(+97 -0)📄 Description
What
Reserve the block's byte range with fallocate(FALLOC_FL_KEEP_SIZE) before handing out mmap write access (write_block and mmap_mut_for_block). Disk exhaustion now surfaces as a plain ENOSPC refill error, and reads fall back to the source exactly like the existing cache-capacity-full path. Filesystems without fallocate support (EOPNOTSUPP/ENOSYS) keep the previous behavior.
Why
The full-file cache writes refilled blocks through a shared mmap over a sparse data file. Writing into an unallocated hole makes the kernel allocate filesystem blocks at page-fault time; when the local disk is full that allocation fails and the process is killed with SIGBUS, taking down the whole ublk-daemon.
Design and behavior changes
Before write into mmap region of cache files, an extra
fallocatesyscall will be invoked.Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetChecklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.