mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
DiskTopology::probe() returned a hardcoded 512 for regular files, causing O_DIRECT failures on volumes with larger block sizes (e.g. 4K). Use statx(STATX_DIOALIGN) (Linux >= 6.1) to query the real per file DIO memory and offset alignment. Unlike fstatvfs().f_bsize, which only returns the filesystem preferred I/O block size, STATX_DIOALIGN reports the true DIO constraints accounting for the filesystem, underlying block device, and any stacking (loop, dm, etc.). Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>