On Tue, Sep 08, 2026 at 02:25:32PM -0400, Chuck Lever wrote:
> Per our discussion last October:
> 
>   https://lore.kernel.org/linux-nfs/[email protected]/
> 
> The conclusion then was that -EINVAL from ->write_iter can come from
> a number of conditions in the filesystem, so NFSD can't treat it as
> meaning only that the I/O was misaligned. That still holds, so I'd
> rather not use -EINVAL to signal a retry. An -EINVAL that really is
> the filesystem rejecting the request would now cost a second full
> write attempt before surfacing anyway.

Exactly.

> What would help me understand the failure even better:
> 
> - Which -EINVAL in bio_split_io_at() fired: the per-bvec dma_alignment
>   test, or the zero-length result after ALIGN_DOWN()?
> 
> - On the reproducer, how does stx_dio_offset_align compare with the
>   queue's logical_block_size?
> 
> If there turn out to be cases the gate can't predict from the statx
> data, that seems like a question for the block and fs folks about
> what error the filesystem should surface, rather than something to
> work around in NFSD.

We shouldn't have such a case, but if we have we need to have a clear
API to discover it.  Note that Keith has been looking into a proper
uapi to discover all the alignment pitfalls, which I hope we can
land rather sooner or later.  nfsd could consume it the same way
as userspace, and we could write userspace reproducer for any
corner cases we need to clarify.

Reply via email to