mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Wilfred Mallawa <wilfred.opensource@gmail.com>
Cc: Carlos Maiolino <cem@kernel.org>,
	"Darrick J . Wong" <djwong@kernel.org>,
	linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>,
	Wilfred Mallawa <wilfred.mallawa@wdc.com>
Subject: Re: [PATCH] xfs: add static size checks for structures in xfs_fs.h
Date: Sat, 7 Feb 2026 09:27:07 +1100	[thread overview]
Message-ID: <aYZquyDjPqZIcKe4@dread.disaster.area> (raw)
In-Reply-To: <20260206030557.1201204-2-wilfred.opensource@gmail.com>

On Fri, Feb 06, 2026 at 01:05:58PM +1000, Wilfred Mallawa wrote:
> From: Wilfred Mallawa <wilfred.mallawa@wdc.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.

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.

IOWs, if these structures checks are sized to pass on x86_64, I'd
expect this change to result in build failures on various 32 bit
platforms....

-Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2026-02-06 22:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06  3:05 Wilfred Mallawa
2026-02-06  6:08 ` Christoph Hellwig
2026-02-09  7:04   ` Wilfred Mallawa
2026-02-09 14:47     ` hch
2026-02-10  5:59       ` Wilfred Mallawa
2026-02-06  9:39 ` kernel test robot
2026-02-06 11:02 ` kernel test robot
2026-02-06 18:03 ` kernel test robot
2026-02-06 22:27 ` Dave Chinner [this message]
2026-02-09  6:57   ` Wilfred Mallawa
2026-02-09 14:41   ` Christoph Hellwig

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=aYZquyDjPqZIcKe4@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=wilfred.mallawa@wdc.com \
    --cc=wilfred.opensource@gmail.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

Powered by JetHome