On Tue, May 2, 2023 at 2:11 AM Hannes Reinecke <hare@xxxxxxx> wrote: > > On 5/2/23 11:00, Luis Chamberlain wrote: > > When using direct IO of say 4k on a 32k physical block size device > > we crash. The amount of data requested must match the minimum IO supported > > by the device but instead we take it for a ride right now and try to fail > > later after checking alignments. > > Something is askew with that reasoning. > If the above were true, we would also crash if we were attempting a 512 > byte direct I/O write on a 4k drive. We do fail, the question is if the math with iov_iter_revert() is right for the failed return value when unaligned. > And I'm reasonably sure that we don't. > > So where's the difference? I think a different return value used which busts iov_iter_revert(). Luis