linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* xdr_stream interface oddities with pages vs stream
@ 2025-12-16 22:26 Mike Snitzer
  2025-12-17 13:54 ` Chuck Lever
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Snitzer @ 2025-12-16 22:26 UTC (permalink / raw)
  To: linux-nfs

Hi,

I've been working on enhancing the NFS client and server such that
nfs4_{set,set}acl utilities to set/get 4.0 ACLs will work when NFSD
v4.1 is reexporting NFS v4.2.  Its soul sucking, but that aside...

In my journey I'm finding that xdr_stream_decode_u32() followed by
xdr_stream_subsegment() doesn't continue from the point where
xdr_stream_decode_u32() advanced xdr_stream's ->p

xdr_stream_subsegment() doesn't appear in any way interlocked with the
pages offset (->p), it starts with xdr_stream_pos() but  ends with
advancing ->p.  So xdr_stream_subsegment() does what it should, I'm
concerned about interfaces like xdr_stream_decode_u32() not advancing
xdr->nwords

Shouldn't both the xdr->p and xdr->nwords be interlocked?  SO that
xdr_stream_subsegment() continues from the point where
xdr_stream_decode_u32() advanced the stream?

Could this possibly be a regression due to more recent scratch buffer
changes?

Anyway.. I'm stabbing/fishing here and hoping someone else knows how
things _should_ work.

Thanks,
Mike

ps. I can expound on what I'm seeing, I just don't want to bury people
right out of the gate ;)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xdr_stream interface oddities with pages vs stream
  2025-12-16 22:26 xdr_stream interface oddities with pages vs stream Mike Snitzer
@ 2025-12-17 13:54 ` Chuck Lever
  2025-12-18 16:56   ` Mike Snitzer
  0 siblings, 1 reply; 3+ messages in thread
From: Chuck Lever @ 2025-12-17 13:54 UTC (permalink / raw)
  To: Mike Snitzer, linux-nfs



On Tue, Dec 16, 2025, at 5:26 PM, Mike Snitzer wrote:
> Hi,
>
> I've been working on enhancing the NFS client and server such that
> nfs4_{set,set}acl utilities to set/get 4.0 ACLs will work when NFSD
> v4.1 is reexporting NFS v4.2.  Its soul sucking, but that aside...
>
> In my journey I'm finding that xdr_stream_decode_u32() followed by
> xdr_stream_subsegment() doesn't continue from the point where
> xdr_stream_decode_u32() advanced xdr_stream's ->p
>
> xdr_stream_subsegment() doesn't appear in any way interlocked with the
> pages offset (->p), it starts with xdr_stream_pos() but  ends with
> advancing ->p.  So xdr_stream_subsegment() does what it should, I'm
> concerned about interfaces like xdr_stream_decode_u32() not advancing
> xdr->nwords
>
> Shouldn't both the xdr->p and xdr->nwords be interlocked?  SO that
> xdr_stream_subsegment() continues from the point where
> xdr_stream_decode_u32() advanced the stream?

From the wasteland that is my memory... I think only one side
uses nwords, and I'm betting it's the encode side. These aren't
exactly symmetrical APIs, and the differences can be subtle.


> Could this possibly be a regression due to more recent scratch buffer
> changes?
>
> Anyway.. I'm stabbing/fishing here and hoping someone else knows how
> things _should_ work.
>
> Thanks,
> Mike
>
> ps. I can expound on what I'm seeing, I just don't want to bury people
> right out of the gate ;)

-- 
Chuck Lever

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xdr_stream interface oddities with pages vs stream
  2025-12-17 13:54 ` Chuck Lever
@ 2025-12-18 16:56   ` Mike Snitzer
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Snitzer @ 2025-12-18 16:56 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs

On Wed, Dec 17, 2025 at 08:54:36AM -0500, Chuck Lever wrote:
> 
> 
> On Tue, Dec 16, 2025, at 5:26 PM, Mike Snitzer wrote:
> > Hi,
> >
> > I've been working on enhancing the NFS client and server such that
> > nfs4_{set,set}acl utilities to set/get 4.0 ACLs will work when NFSD
> > v4.1 is reexporting NFS v4.2.  Its soul sucking, but that aside...
> >
> > In my journey I'm finding that xdr_stream_decode_u32() followed by
> > xdr_stream_subsegment() doesn't continue from the point where
> > xdr_stream_decode_u32() advanced xdr_stream's ->p
> >
> > xdr_stream_subsegment() doesn't appear in any way interlocked with the
> > pages offset (->p), it starts with xdr_stream_pos() but  ends with
> > advancing ->p.  So xdr_stream_subsegment() does what it should, I'm
> > concerned about interfaces like xdr_stream_decode_u32() not advancing
> > xdr->nwords
> >
> > Shouldn't both the xdr->p and xdr->nwords be interlocked?  SO that
> > xdr_stream_subsegment() continues from the point where
> > xdr_stream_decode_u32() advanced the stream?
> 
> From the wasteland that is my memory... I think only one side
> uses nwords, and I'm betting it's the encode side. These aren't
> exactly symmetrical APIs, and the differences can be subtle.

It was just user error on my part.. (I had expected the acl_pages to
be aligned at the start of the first page in the subsegment I
extracted, but it was offset within that first page).

Move along nothing to see here! ;)

Thannks,
Mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-18 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-16 22:26 xdr_stream interface oddities with pages vs stream Mike Snitzer
2025-12-17 13:54 ` Chuck Lever
2025-12-18 16:56   ` Mike Snitzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).