[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aIh8tQWEO9OQiWZe@infradead.org>
Date: Tue, 29 Jul 2025 00:48:05 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Chuck Lever <chuck.lever@...cle.com>
Cc: NeilBrown <neil@...wn.name>, Christoph Hellwig <hch@...radead.org>,
Sergey Bashirov <sergeybashirov@...il.com>,
Jeff Layton <jlayton@...nel.org>,
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
Subject: Re: [PATCH v2] NFSD: Rework encoding and decoding of nfsd4_deviceid
On Wed, Jul 23, 2025 at 10:35:29AM -0400, Chuck Lever wrote:
> > We could document it in the code with __no_randomize_layout after the
> > structure definition.
>
> We might also want __attribute__((packed)) or even
> __attribute__((packed, aligned(4))).
Absolute not. packed causes horrible code generation, and
__attribute__((packed, aligned(4))) will probably break things
that didn't properly pad (although they really should).
> That still leaves undocumented the fact that the fields in the structure
> are treated as both endian types. In most other XDR functions we have
> been careful to write source code that shows where endianness changes
> or, conversely, where endianness is not consequential.
I'm not arguing against doing XDR things in XDR code. But the rest of
the kernel works very different.
Powered by blists - more mailing lists