Re: [PATCH, RFC] libxfs: check the size of on-disk data structures

Christoph Hellwig
2023-12-04T20:04:46Z

On Mon, Dec 04, 2023 at 11:53:06AM -0800, Darrick J. Wong wrote:
> > #define XFS_CHECK_VALUE(value, expected) \
> > - BUILD_BUG_ON_MSG((value) != (expected), \
> > + static_assert((value) == (expected), \
>
> HAH LOL that's much better. I think I even see that kernel code is
> using it now, and wonder why BUG_BUILD_ON still exists.

Yup:

hch@brick:~/work/linux$ git-grep static_assert | wc -l
840
hch@brick:~/work/linux$ git-grep BUILD_BUG_ON_MSG | wc -l
92

> Going back for another cup of koolaid now,

Haha.

> Reviewed-by: Darrick J. Wong <djwong@kernel.org>

Thanks. I was just getting ready to send out a series with this and
the xfs_ondisk.h move.