Re: [PATCHv2 1/2] blktests: test direct io offsets

Keith Busch
2025-11-20T14:33:00Z

On Thu, Nov 20, 2025 at 12:56:36AM +0000, Chaitanya Kulkarni wrote:
> On 11/19/25 15:59, Keith Busch wrote:
> > On Wed, Nov 19, 2025 at 11:48:47PM +0000, Chaitanya Kulkarni wrote:
> >> On 11/19/25 11:54, Keith Busch wrote:
> >>> + ret = pwritev(test_fd, iov, vecs, 0);
> >>> + if (ret < 0)
> >>> + err(errno, "%s: failed to read buf", __func__);
> >>> +
> >>
> >> is pwritev correct above or it should be preadv () ?
> > Good eye, it should have been preadv. This part is currently unreachable
> > though, as it requires byte-aligned dma limits and the kernel doesn't
> > report such a value. But if this were to run, the test would have
> > falsely declared data corruption.
>
> how about ?
>
> 1. Keep the code but disable it until kernel gets that support ? OR
> 2. add an ability to autodetect if kernel has a support before running the
> test else skip test_invalid_dma_vector_length() ?

It already does the second one. This test function checks the device's
dma alignment requirements and purposefully dispatches a command that is
expected to fail before it reaches this part.