* [PATCH v3 1/2] xfs: remove duplicate static size checks
@ 2026-02-11 3:29 Wilfred Mallawa
2026-02-11 3:29 ` [PATCH v3 2/2] xfs: add static size checks for ioctl UABI Wilfred Mallawa
2026-02-25 9:38 ` [PATCH v3 1/2] xfs: remove duplicate static size checks Carlos Maiolino
0 siblings, 2 replies; 3+ messages in thread
From: Wilfred Mallawa @ 2026-02-11 3:29 UTC (permalink / raw)
To: Carlos Maiolino, Darrick J . Wong
Cc: linux-xfs, linux-kernel, Christoph Hellwig, Wilfred Mallawa
From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
In libxfs/xfs_ondisk.h, remove some duplicate entries of
XFS_CHECK_STRUCT_SIZE().
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
V2 -> V3:
- No change
---
fs/xfs/libxfs/xfs_ondisk.h | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_ondisk.h b/fs/xfs/libxfs/xfs_ondisk.h
index 2e9715cc1641..601a8367ced6 100644
--- a/fs/xfs/libxfs/xfs_ondisk.h
+++ b/fs/xfs/libxfs/xfs_ondisk.h
@@ -136,16 +136,7 @@ xfs_check_ondisk_structs(void)
/* ondisk dir/attr structures from xfs/122 */
XFS_CHECK_STRUCT_SIZE(struct xfs_attr_sf_entry, 3);
XFS_CHECK_STRUCT_SIZE(struct xfs_dir2_data_free, 4);
- XFS_CHECK_STRUCT_SIZE(struct xfs_dir2_data_hdr, 16);
XFS_CHECK_STRUCT_SIZE(struct xfs_dir2_data_unused, 6);
- XFS_CHECK_STRUCT_SIZE(struct xfs_dir2_free, 16);
- XFS_CHECK_STRUCT_SIZE(struct xfs_dir2_free_hdr, 16);
- XFS_CHECK_STRUCT_SIZE(struct xfs_dir2_leaf, 16);
- XFS_CHECK_STRUCT_SIZE(struct xfs_dir2_leaf_entry, 8);
- XFS_CHECK_STRUCT_SIZE(struct xfs_dir2_leaf_hdr, 16);
- XFS_CHECK_STRUCT_SIZE(struct xfs_dir2_leaf_tail, 4);
- XFS_CHECK_STRUCT_SIZE(struct xfs_dir2_sf_entry, 3);
- XFS_CHECK_STRUCT_SIZE(struct xfs_dir2_sf_hdr, 10);
/* log structures */
XFS_CHECK_STRUCT_SIZE(struct xfs_buf_log_format, 88);
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v3 2/2] xfs: add static size checks for ioctl UABI
2026-02-11 3:29 [PATCH v3 1/2] xfs: remove duplicate static size checks Wilfred Mallawa
@ 2026-02-11 3:29 ` Wilfred Mallawa
2026-02-25 9:38 ` [PATCH v3 1/2] xfs: remove duplicate static size checks Carlos Maiolino
1 sibling, 0 replies; 3+ messages in thread
From: Wilfred Mallawa @ 2026-02-11 3:29 UTC (permalink / raw)
To: Carlos Maiolino, Darrick J . Wong
Cc: linux-xfs, linux-kernel, Christoph Hellwig, Wilfred Mallawa
From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
The ioctl structures in libxfs/xfs_fs.h are missing static size checks.
It is useful to have static size checks for these structures as adding
new fields to them could cause issues (e.g. extra padding that may be
inserted by the compiler). So add these checks to xfs/xfs_ondisk.h.
Due to different padding/alignment requirements across different
architectures, to avoid build failures, some structures are ommited from
the size checks. For example, structures with "compat_" definitions in
xfs/xfs_ioctl32.h are ommited.
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
V2 -> V3:
- Drop excess whitespace
---
fs/xfs/libxfs/xfs_ondisk.h | 39 +++++++++++++++++++++++++++++++++-----
1 file changed, 34 insertions(+), 5 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_ondisk.h b/fs/xfs/libxfs/xfs_ondisk.h
index 601a8367ced6..1914ffe59202 100644
--- a/fs/xfs/libxfs/xfs_ondisk.h
+++ b/fs/xfs/libxfs/xfs_ondisk.h
@@ -208,11 +208,6 @@ xfs_check_ondisk_structs(void)
XFS_CHECK_OFFSET(struct xfs_dir3_free, hdr.hdr.magic, 0);
XFS_CHECK_OFFSET(struct xfs_attr3_leafblock, hdr.info.hdr, 0);
- XFS_CHECK_STRUCT_SIZE(struct xfs_bulkstat, 192);
- XFS_CHECK_STRUCT_SIZE(struct xfs_inumbers, 24);
- XFS_CHECK_STRUCT_SIZE(struct xfs_bulkstat_req, 64);
- XFS_CHECK_STRUCT_SIZE(struct xfs_inumbers_req, 64);
-
/*
* Make sure the incore inode timestamp range corresponds to hand
* converted values based on the ondisk format specification.
@@ -292,6 +287,40 @@ xfs_check_ondisk_structs(void)
XFS_CHECK_SB_OFFSET(sb_pad, 281);
XFS_CHECK_SB_OFFSET(sb_rtstart, 288);
XFS_CHECK_SB_OFFSET(sb_rtreserved, 296);
+
+ /*
+ * ioctl UABI
+ *
+ * Due to different padding/alignment requirements across
+ * different architectures, some structures are ommited from
+ * the size checks. In addition, structures with architecture
+ * dependent size fields are also ommited (e.g. __kernel_long_t).
+ */
+ XFS_CHECK_STRUCT_SIZE(struct xfs_bulkstat, 192);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_inumbers, 24);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_bulkstat_req, 64);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_inumbers_req, 64);
+ XFS_CHECK_STRUCT_SIZE(struct dioattr, 12);
+ XFS_CHECK_STRUCT_SIZE(struct getbmap, 32);
+ XFS_CHECK_STRUCT_SIZE(struct getbmapx, 48);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_cursor, 16);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist, 8);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist, 8);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_ent, 4);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_ag_geometry, 128);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_rtgroup_geometry, 128);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_error_injection, 8);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_fsop_geom, 256);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_fsop_geom_v4, 112);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_fsop_counts, 32);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_fsop_resblks, 16);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_growfs_log, 8);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_bulk_ireq, 64);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_fs_eofblocks, 128);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_fsid, 8);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_scrub_metadata, 64);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_scrub_vec, 16);
+ XFS_CHECK_STRUCT_SIZE(struct xfs_scrub_vec_head, 40);
}
#endif /* __XFS_ONDISK_H */
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3 1/2] xfs: remove duplicate static size checks
2026-02-11 3:29 [PATCH v3 1/2] xfs: remove duplicate static size checks Wilfred Mallawa
2026-02-11 3:29 ` [PATCH v3 2/2] xfs: add static size checks for ioctl UABI Wilfred Mallawa
@ 2026-02-25 9:38 ` Carlos Maiolino
1 sibling, 0 replies; 3+ messages in thread
From: Carlos Maiolino @ 2026-02-25 9:38 UTC (permalink / raw)
To: Darrick J . Wong, Wilfred Mallawa
Cc: linux-xfs, linux-kernel, Christoph Hellwig, Wilfred Mallawa
On Wed, 11 Feb 2026 13:29:02 +1000, Wilfred Mallawa wrote:
> In libxfs/xfs_ondisk.h, remove some duplicate entries of
> XFS_CHECK_STRUCT_SIZE().
>
>
Applied to for-next, thanks!
[1/2] xfs: remove duplicate static size checks
commit: 3ab9082fcda0ce7d1b9fcfc3fee5b66f82c4edf2
[2/2] xfs: add static size checks for ioctl UABI
commit: d7a47448177783ecdb9faa96770006ce660b7c62
Best regards,
--
Carlos Maiolino <cem@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-25 9:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-11 3:29 [PATCH v3 1/2] xfs: remove duplicate static size checks Wilfred Mallawa
2026-02-11 3:29 ` [PATCH v3 2/2] xfs: add static size checks for ioctl UABI Wilfred Mallawa
2026-02-25 9:38 ` [PATCH v3 1/2] xfs: remove duplicate static size checks Carlos Maiolino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox