public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Sergey Bashirov <sergeybashirov@gmail.com>,
	Jeff Layton <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Konstantin Evtushenko <koevtushenko@yandex.com>
Subject: Re: [PATCH v2] nfsd: Implement large extent array support in pNFS
Date: Wed, 11 Jun 2025 10:51:51 -0400	[thread overview]
Message-ID: <3f3647f8-5359-4729-bf06-cce8efc6cff9@oracle.com> (raw)
In-Reply-To: <aEkouh-uedz1_c4m@infradead.org>

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

  reply	other threads:[~2025-06-11 14:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10  1:18 [PATCH v2] nfsd: Implement large extent array support in pNFS Sergey Bashirov
2025-06-10 18:10 ` Chuck Lever
2025-06-11  6:56   ` Christoph Hellwig
2025-06-11 14:51     ` Chuck Lever [this message]
2025-06-13 12:01   ` Sergey Bashirov
2025-06-13 16:12     ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f3647f8-5359-4729-bf06-cce8efc6cff9@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=Dai.Ngo@oracle.com \
    --cc=hch@infradead.org \
    --cc=jlayton@kernel.org \
    --cc=koevtushenko@yandex.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=sergeybashirov@gmail.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox