[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b1a2d202d6ee94fb484ebdb50d8737490177c3d8.camel@wdc.com>
Date: Mon, 9 Feb 2026 06:57:43 +0000
From: Wilfred Mallawa <wilfred.mallawa@....com>
To: "david@...morbit.com" <david@...morbit.com>
CC: hch <hch@....de>, "djwong@...nel.org" <djwong@...nel.org>,
"linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"cem@...nel.org" <cem@...nel.org>
Subject: Re: [PATCH] xfs: add static size checks for structures in xfs_fs.h
On Sat, 2026-02-07 at 09:27 +1100, Dave Chinner wrote:
> On Fri, Feb 06, 2026 at 01:05:58PM +1000, Wilfred Mallawa wrote:
> > From: Wilfred Mallawa <wilfred.mallawa@....com>
> >
> > This patch adds static size checks for the structures in
> > libxfs/xfs_fs.h. The structures with architecture dependent size
> > for
> > fields are ommited from this patch (such as xfs_bstat which depends
> > on
> > __kernel_long_t).
>
> There's more than that.
>
> Different architectures will have different padding, alignment and
> holes for the same structure (e.g. 32 bit vs 64 bit) resulting in
> different sizes for the same structure across different platforms.
>
Ah I see. As you mentioned I do see build failures from testbot for
32bit configs. Failure on the following structures (size was calculated
for 64b).
xfs_flock64
xfs_fsop_geom_v1
xfs_growfs_data_t
xfs_growfs_rt_t
xfs_inogrp
Which checks out with having different alignment requirements. i.e
xfs_growfs_data_t would be 16B for 64b and 12B for 32b.
> This is not actually a bug in the UAPI - as long as the
> architecture's userspace and the kernel are using the same structure
> layout, variations in structure size and layout between architectures
> don't matter.
The main reason for this patch was to have as many of the UAPI
structures covered by size checks such that we would catch size changes
(padding etc...) when these structs are modified.
Would omitting the above listed and keeping the rest of the new
addition be sufficient? or are there different configs that this would
cause issues for regardless?
In any case, I will split out the deletions of the duplicates and send
that patch separately as Christoph suggested.
Regards,
Wilfred
Powered by blists - more mailing lists