From: Dave Chinner <david@fromorbit.com>
To: Mark Tinguely <tinguely@sgi.com>
Cc: Brian Foster <bfoster@redhat.com>,
Roger Willcocks <roger@filmlight.ltd.uk>,
xfs@oss.sgi.com
Subject: Re: [PATCH v6 09/10] xfs: add minimum file size filtering to eofblocks scan
Date: Wed, 7 Nov 2012 09:29:37 +1100 [thread overview]
Message-ID: <20121106222937.GJ24575@dastard> (raw)
In-Reply-To: <509963BC.3090801@sgi.com>
On Tue, Nov 06, 2012 at 01:23:40PM -0600, Mark Tinguely wrote:
> On 11/06/12 12:00, Brian Foster wrote:
> >On 11/06/2012 12:08 PM, Roger Willcocks wrote:
> >>
> >>On Tue, 2012-11-06 at 10:57 -0600, Mark Tinguely wrote:
> >>>On 11/06/12 08:50, Brian Foster wrote:
> >>>>Support minimum file size filtering in the eofblocks scan. The
> >>>>caller must set the XFS_EOF_FLAGS_MINFILESIZE flags bit and minimum
> >>>>file size value in bytes.
> >>>>
> >>>>Signed-off-by: Brian Foster<bfoster@redhat.com>
> >>>>---
> >>>> fs/xfs/xfs_fs.h | 6 ++++--
> >>>> fs/xfs/xfs_icache.c | 11 +++++++++--
> >>>> 2 files changed, 13 insertions(+), 4 deletions(-)
> >>>>
> >>>>diff --git a/fs/xfs/xfs_fs.h b/fs/xfs/xfs_fs.h
> >>>>index 88eb1bc..082b743 100644
> >>>>--- a/fs/xfs/xfs_fs.h
> >>>>+++ b/fs/xfs/xfs_fs.h
> >>>>@@ -348,7 +348,8 @@ struct xfs_eofblocks {
> >>>> uid_t eof_uid;
> >>>> gid_t eof_gid;
> >>>> prid_t eof_prid;
> >>>>- __u32 pad[27];
> >>>>+ __u64 eof_min_file_size;
> >>>>+ __u32 pad[25]
> >>> ^^
> >>>Glad you bumped it to a unsigned 64 bit value.
> >>>Are __u64 items 64 bits? if so, the pad would be 24
> >>>
> >>
> >>It should probably be:
> >>
> >>__u32 pad_align_64;
> >>__u64 eof_min_file_size;
> >>__u32 pad[24];
> >>
> >
> >Doh... forgot about alignment. Thanks for catching that guys.
> >
> >The new pad_align field means I have to fix up the padded zero check as
> >well, which makes me wonder if I should reorder things now or actually
> >split more of the padding space into two (__u32/__u64, rather than
> >mistakenly converting to a __u32 like I've done here) fields to support
> >extending the data structure with fields of either size without having
> >to update the version. E.g., we end up with something like the following:
> >
> >struct xfs_eofblocks {
> > __u32 version;
> > __u32 flags;
> > uid_t uid;
> > gid_t gid;
> > prid_t prid;
> > __u32 pad32[9];
> > __u64 minfilesize;
> > __u64 pad64[8];
> >};
Just pad the 32 bit hole. If someone is adding an odd number of 32
bit variables later, they can fill the hole, otherwise is can remain
there until we add an odd number of 32 bit variables.
> I vote to keep the padding continuous at the end of the series
> and the padding check simple:
>
> struct xfs_eofblocks {
> __u32 version;
> __u32 flags;
> __u64 minfilesize;
> uid_t uid;
> gid_t gid;
> prid_t prid;
> __u32 pad32[25];
That just leaves us open to exactly the same mistake - there's
no indication that alignment and padding holes explicitly might
be important for this structure.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-11-06 22:27 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-06 14:50 [PATCH v6 00/10] speculative preallocation inode tracking Brian Foster
2012-11-06 14:50 ` [PATCH v6 01/10] xfs: add EOFBLOCKS inode tagging/untagging Brian Foster
2012-11-06 14:50 ` [PATCH v6 02/10] xfs: support a tag-based inode_ag_iterator Brian Foster
2012-11-06 14:50 ` [PATCH v6 03/10] xfs: create helper to check whether to free eofblocks on inode Brian Foster
2012-11-06 14:50 ` [PATCH v6 04/10] xfs: make xfs_free_eofblocks() non-static, return EAGAIN on trylock failure Brian Foster
2012-11-06 14:50 ` [PATCH v6 05/10] xfs: create function to scan and clear EOFBLOCKS inodes Brian Foster
2012-11-06 14:50 ` [PATCH v6 06/10] xfs: add XFS_IOC_FREE_EOFBLOCKS ioctl Brian Foster
2012-11-06 16:44 ` Mark Tinguely
2012-11-06 22:11 ` Dave Chinner
2012-11-06 14:50 ` [PATCH v6 07/10] xfs: add inode id filtering to eofblocks scan Brian Foster
2012-11-06 16:41 ` Mark Tinguely
2012-11-06 17:57 ` Brian Foster
2012-11-06 22:17 ` Dave Chinner
2012-11-06 14:50 ` [PATCH v6 08/10] xfs: support multiple inode id filtering in " Brian Foster
2012-11-06 16:48 ` Mark Tinguely
2012-11-06 22:20 ` Dave Chinner
2012-11-06 14:50 ` [PATCH v6 09/10] xfs: add minimum file size filtering to " Brian Foster
2012-11-06 16:57 ` Mark Tinguely
2012-11-06 17:08 ` Roger Willcocks
2012-11-06 18:00 ` Brian Foster
2012-11-06 19:23 ` Mark Tinguely
2012-11-06 22:29 ` Dave Chinner [this message]
2012-11-06 22:25 ` Dave Chinner
2012-11-06 14:50 ` [PATCH v6 10/10] xfs: add background scanning to clear eofblocks inodes Brian Foster
2012-11-06 17:04 ` Mark Tinguely
2012-11-06 22:30 ` Dave Chinner
2012-11-07 17:21 ` [PATCH v7 06/10] xfs: add XFS_IOC_FREE_EOFBLOCKS ioctl Brian Foster
2012-11-07 17:21 ` [PATCH v7 07/10] xfs: add inode id filtering to eofblocks scan Brian Foster
2012-11-07 20:33 ` Dave Chinner
2012-11-07 17:21 ` [PATCH v7 09/10] xfs: add minimum file size " Brian Foster
2012-11-07 20:33 ` Dave Chinner
2012-11-08 22:38 ` [PATCH v6 00/10] speculative preallocation inode tracking Ben Myers
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=20121106222937.GJ24575@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=roger@filmlight.ltd.uk \
--cc=tinguely@sgi.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