From: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com, "Darrick J. Wong" <darrick.wong@oracle.com>
Subject: Re: [PATCH] xfs: check sizes of XFS on-disk structures at compile time
Date: Wed, 20 Jan 2016 10:40:36 -0500 [thread overview]
Message-ID: <20160120154035.GH1366@meili.valhalla.31bits.net> (raw)
In-Reply-To: <20160115225219.GP6033@dastard>
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@oracle.com>
> ....
> > > + 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.
Doesn't this turn into nothingness as far as the generated binary is
concerned? Because if it does, I don't see a reason to keep it debug-only.
Afterall, non-debug builds need to be correct and these are pretty important
checks. We certainly don't want another ARM structure padding & alignment
fiasco.
Just my 2 cents,
Jeff.
--
Only two things are infinite, the universe and human stupidity, and I'm not
sure about the former.
- Albert Einstein
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-01-20 15:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-11 23:26 [PATCH] xfs: check sizes of XFS on-disk structures at compile time Darrick J. Wong
2016-01-12 14:01 ` Brian Foster
2016-01-13 18:25 ` Eric Sandeen
2016-01-15 21:05 ` Darrick J. Wong
2016-01-15 20:58 ` Darrick J. Wong
2016-01-15 22:52 ` Dave Chinner
2016-01-20 5:12 ` Darrick J. Wong
2016-01-20 15:40 ` Josef 'Jeff' Sipek [this message]
2016-01-22 22:01 ` Darrick J. Wong
2016-02-01 5:06 ` Dave Chinner
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=20160120154035.GH1366@meili.valhalla.31bits.net \
--to=jeffpc@josefsipek.net \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.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