xfs
[Top] [All Lists]

Re: [PATCH] xfs: check sizes of XFS on-disk structures at compile time

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs: check sizes of XFS on-disk structures at compile time
From: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
Date: Tue, 19 Jan 2016 21:12:48 -0800
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160115225219.GP6033@dastard>
References: <20160111232657.GA7831@xxxxxxxxxxxxxxxx> <20160115205801.GB5757@xxxxxxxxxxxxxxxx> <20160115225219.GP6033@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
On Sat, Jan 16, 2016 at 09:52:19AM +1100, Dave Chinner wrote:
> On Fri, Jan 15, 2016 at 12:58:01PM -0800, Darrick J. Wong wrote:
> > On Mon, Jan 11, 2016 at 03:26:57PM -0800, Darrick J. Wong wrote:
> > > Check the sizes of XFS on-disk structures when compiling the kernel.
> > > Use this to catch inadvertent changes in structure size due to padding
> > > and alignment issues, etc.
> > > 
> > > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ....
> > > + XFS_CHECK_STRUCT_SIZE(struct xfs_efi_log_format_64,     32);
> > > + XFS_CHECK_STRUCT_SIZE(struct xfs_efd_log_format_32,     28);
> > > + XFS_CHECK_STRUCT_SIZE(struct xfs_efd_log_format_64,     32);
> > > + XFS_CHECK_STRUCT_SIZE(struct xfs_dq_logformat,          24);
> > > + XFS_CHECK_STRUCT_SIZE(struct xfs_qoff_logformat,        20);
> > > + XFS_CHECK_STRUCT_SIZE(struct xfs_icreate_log,           28);
> > > +}
> > 
> > Perhaps this huge function ought to hide away in its own file?
> 
> Yes, I think that's a good idea, and I think it should only be built
> on debug builds, too.

Ok, I'll make it go away when !CONFIG_XFS_DEBUG.

--D

> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>