On Mon, Oct 25, 2021 at 05:44:34PM +0800, Ming Lei wrote: > DIO submission on underlying file may fail because of unaligned buffer or > start_sector & sector_length, fallback to buffered IO when that happens, > this way will make loop dio mode more reliable. I don't think this is a good idea. Just do an ahead of time check that the alignment matches and don't even try to use direct I/O code in that case. Otherwise we get a mix and match between buffered and direct I/O, which is actively harmful.