[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3f3647f8-5359-4729-bf06-cce8efc6cff9@oracle.com>
Date: Wed, 11 Jun 2025 10:51:51 -0400
From: Chuck Lever <chuck.lever@...cle.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Sergey Bashirov <sergeybashirov@...il.com>,
Jeff Layton <jlayton@...nel.org>, NeilBrown <neil@...wn.name>,
Olga Kornievskaia <okorniev@...hat.com>, Dai Ngo <Dai.Ngo@...cle.com>,
Tom Talpey <tom@...pey.com>, linux-nfs@...r.kernel.org,
linux-kernel@...r.kernel.org,
Konstantin Evtushenko <koevtushenko@...dex.com>
Subject: Re: [PATCH v2] nfsd: Implement large extent array support in pNFS
On 6/11/25 2:56 AM, Christoph Hellwig wrote:
> 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.
XDR subsegments are useful when another layer will be responsible for
encoding or decoding the field. Generally a subsegment contains an
opaque (an operation in an NFSv4 COMPOUND, a read or write payload, or
an RPCGSS_SEC payload that is checksummed or encrypted).
For pNFS, the layout metadata has to be skipped over when it is
encountered in a generic operation like LAYOUTCOMMIT, but then it is
later handled by another layer (the layouttype-specific plug-in, which
is part of an "upper layer").
The generic layer has to confirm that the length of the opaque is
correct, skip over that length, and then continue marshaling or
unmarshaling fields after the opaque.
--
Chuck Lever
Powered by blists - more mailing lists