Re: [PATCH v2] nfsd: Implement large extent array support in pNFS

From: Christoph Hellwig
Date: Wed Jun 11 2025 - 02:57:18 EST


On Tue, Jun 10, 2025 at 02:10:46PM -0400, Chuck Lever wrote:
> > + if (xdr_stream_decode_u32(argp->xdr, &len) < 0)
> > + return nfserr_bad_xdr;
> > + if (!xdr_stream_subsegment(argp->xdr, &lcp->lc_up_layout, len))
> > return nfserr_bad_xdr;
>
> The layout is effectively an opaque payload at this point, so using
> xdr_stream_subsegment() makes sense to me.

Btw, when trying to switch XDR to work with bvec backing,
xdr_stream_subsegment has been a very painful primitive. I also don't
really understand what the benefit of it is vs just keeping on decoding
the subsegment normally. That might just be me not understanding the
code, though.