Re: Out of order read() completion and buffer filling beyond returned amount

From: Christoph Hellwig
Date: Tue Jan 18 2022 - 02:26:13 EST


On Mon, Jan 17, 2022 at 01:30:05PM +0000, Matthew Wilcox wrote:
> I think for DIO, you're sacrificing the entire buffer with any filesystem.
> If the underlying file is split across multiple drives, or is even
> just fragmented on a single drive, we'll submit multiple BIOs which
> will complete independently (even for SCSI which writes sequentially;
> never mind NVMe which can DMA blocks asynchronously). It might be
> more apparent in a networking situation where errors are more common,
> but it's always been a possibility since Linux introduced DIO.

Yes. Probably because of that we also never allow short reads or writes
due to I/O errrors but always fail the whole I/O.