Re: [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-03 Thread Stefan Hajnoczi
On Thu, Nov 03, 2022 at 04:54:09PM +, Eric Biggers wrote: > On Thu, Nov 03, 2022 at 04:26:14PM +, Eric Biggers wrote: > > > In other words, STATX_DIOALIGN is unusable from the start because we > > > don't know whether the information it returns is actually correct? :-/ > > > > That's a

Re: [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-03 Thread Eric Biggers
On Thu, Nov 03, 2022 at 04:26:14PM +, Eric Biggers wrote: > > In other words, STATX_DIOALIGN is unusable from the start because we > > don't know whether the information it returns is actually correct? :-/ > > That's a silly point of view. STATX_DIOALIGN has only been in a released > kernel

Re: [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-03 Thread Eric Biggers
On Thu, Nov 03, 2022 at 10:52:43AM +0100, Kevin Wolf wrote: > Am 02.11.2022 um 03:49 hat Eric Biggers geschrieben: > > On Tue, Nov 01, 2022 at 07:27:16PM -0700, Eric Biggers wrote: > > > On Tue, Nov 01, 2022 at 03:00:30PM -0400, Stefan Hajnoczi wrote: > > > > Linux dm-crypt returns errno EIO from

Re: [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-03 Thread Stefan Hajnoczi
On Thu, Nov 03, 2022 at 10:52:43AM +0100, Kevin Wolf wrote: > Am 02.11.2022 um 03:49 hat Eric Biggers geschrieben: > > On Tue, Nov 01, 2022 at 07:27:16PM -0700, Eric Biggers wrote: > > > On Tue, Nov 01, 2022 at 03:00:30PM -0400, Stefan Hajnoczi wrote: > > > > Linux dm-crypt returns errno EIO from

Re: [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-03 Thread Kevin Wolf
Am 02.11.2022 um 03:49 hat Eric Biggers geschrieben: > On Tue, Nov 01, 2022 at 07:27:16PM -0700, Eric Biggers wrote: > > On Tue, Nov 01, 2022 at 03:00:30PM -0400, Stefan Hajnoczi wrote: > > > Linux dm-crypt returns errno EIO from unaligned O_DIRECT pread(2) calls. > > > > Citation needed. For

Re: [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-02 Thread Stefan Hajnoczi
On Tue, Nov 01, 2022 at 07:49:20PM -0700, Eric Biggers wrote: > On Tue, Nov 01, 2022 at 07:27:16PM -0700, Eric Biggers wrote: > > On Tue, Nov 01, 2022 at 03:00:30PM -0400, Stefan Hajnoczi wrote: > > > Linux dm-crypt returns errno EIO from unaligned O_DIRECT pread(2) calls. > > > > Citation

Re: [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-01 Thread Eric Biggers
On Tue, Nov 01, 2022 at 07:27:16PM -0700, Eric Biggers wrote: > On Tue, Nov 01, 2022 at 03:00:30PM -0400, Stefan Hajnoczi wrote: > > Linux dm-crypt returns errno EIO from unaligned O_DIRECT pread(2) calls. > > Citation needed. For direct I/O to block devices, the kernel's block layer > checks

Re: [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-01 Thread Eric Biggers
On Tue, Nov 01, 2022 at 03:00:30PM -0400, Stefan Hajnoczi wrote: > Linux dm-crypt returns errno EIO from unaligned O_DIRECT pread(2) calls. Citation needed. For direct I/O to block devices, the kernel's block layer checks the alignment before the I/O is actually submitted to the underlying block

[PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned

2022-11-01 Thread Stefan Hajnoczi
Linux dm-crypt returns errno EIO from unaligned O_DIRECT pread(2) calls. Alignment probing fails on dm-crypt devices because the code expects EINVAL. Treating any errno as an "unaligned" indicator would be easy, but breaks commit 22d182e82b4b ("block/raw-posix: fix launching with failed disks").