On Mon, Aug 25, 2025 at 09:46:06AM +0200, Christoph Hellwig wrote: > On Tue, Aug 19, 2025 at 09:49:17AM -0700, Keith Busch wrote: > > + > > + if (!bio->bi_iter.bi_size) > > + return -EFAULT; > > And as bi_size doesn't change in the loop, this should probably move > above the loop. The loop also releases pinned pages if necessary. We can't count on the caller to do that if we return error here. __blkdev_direct_IO is the only one that tries to release pages on error, everyone else would leak them.