mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[GH-ISSUE #274] OverlayBD direct I/O hard-codes 512-byte alignment and fails with EINVAL on 4096-byte-sector block devices #75
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#75
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?
Originally created by @ethe on GitHub (Sep 10, 2026).
Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/274
Affected component
OverlayBD / image resolution
AgentENV version
mainatb0d649c411(2026-09-10)Host environment
OS: Ubuntu 24.04 (Depot CI runner image
depot-ubuntu-24.04)Kernel (
uname -a):6.12.8+x86_64Architecture: x86_64
Bare metal, VM, or cloud: cloud VM (Depot-hosted GitHub Actions runner), KVM available
ublk support: yes
CPU: 8 vCPU
Memory: 31 GiB
Storage/filesystem: root is ext4 on
/dev/mapper/root(dm thin pool over virtio disksvda/vdb). The block device reports 4096-byte logical and physical sectors:Operation and configuration
Production exposure with default configuration is limited:
LocalFile::direct_io(true)is only used for lower layers when the image config selectsioEnginelibaio (image_file.rs,direct_io = io_engine == IO_ENGINE_LIBAIO), plus the lsmt direct-I/O paths. On such a host, enabling libaio makes every lower-layer open fail withInvalid argument, and the test suite always fails.Steps to reproduce
TMPDIRsits on a block device withblockdev --getss= 4096 (4K-native NVMe namespaces and some cloud/virtio disks.mainand runmake test-ublk PROFILE=debug.storage/overlaybdfail withEINVAL/EIO.fiocommands above: 512-byte direct I/O fails, 4096-byte direct I/O succeeds, on any of the io_uring, libaio, or psync engines.Expected behavior
storage/overlaybd/src/backend/local.rsshould derive the direct-I/O alignment from the backing device instead of hard-coding it:Linux (ext4/xfs via iomap) rejects O_DIRECT requests unless offset, length and buffer are aligned to the device's logical block size (
bdev_logical_block_size), which is 4096 on these hosts. The backend could queryBLKSSZGETon the underlying device (or usestatx'sstx_dio_mem_align/stx_dio_offset_alignon kernels ≥ 6.1, which report exactly these limits for a file) when opening a direct-I/O file, and sizeAlignedBufferand the offset/length checks from that value. Failing that, opening withdirect_io(true)on such a device should return a clear error naming the required alignment rather than surfacing rawEINVALon the first write.Actual behavior
Eight tests fail, every direct-I/O write or open returns
EINVAL(orEIOfrom the lsmt create path):Logs and diagnostics
Reproduction frequency
Always
Regression information
Pre-submission checklist