[2172145] `O_DIRECT` read into a 512-aligned (not 4096-aligned) buffer returns `EIO` instead of `EINVAL` on a 4096-byte-sector LUKS volume (`dm-crypt`)
LaunchpadBug #2172145 “`O_DIRECT` read into a 512-aligned (not 4096-align...” : Bugs : linux package : UbuntuFull disclosure: an LLM (Claude Sonnet 5.5) was used to debug/pin point the root cause and write this bug report that I've reviewed.
**Summary**
On a LUKS2 volume formatted with 4096-byte sectors, `O_DIRECT` reads into a buffer that is not 4096-byte aligned fail with `EIO`. The `dm` device advertises `dma_alignment=4095`, so the kernel should reject such buffers up front with `EINVAL`. There is