xfs
[Top] [All Lists]

Re: [PATCH v6 09/10] xfs: add minimum file size filtering to eofblocks s

To: Brian Foster <bfoster@xxxxxxxxxx>
Subject: Re: [PATCH v6 09/10] xfs: add minimum file size filtering to eofblocks scan
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 7 Nov 2012 09:25:59 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1352213447-59791-10-git-send-email-bfoster@xxxxxxxxxx>
References: <1352213447-59791-1-git-send-email-bfoster@xxxxxxxxxx> <1352213447-59791-10-git-send-email-bfoster@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Nov 06, 2012 at 09:50:46AM -0500, 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@xxxxxxxxxx>
> ---
>  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];

And that's an exact example of why you should pad out to 8 byte
boundaries like I suggested earlier ;)

What this ends up with is:

        prid            eof_prid;
        <implicit, arch dependent 4 byte hole>
        __u64           eof_min_file_size;
        __32            pad[25];

What you should have is something like:

        prid            eof_prid;
        __u32           pad32;
        __u64           eof_min_file_size;
        __u64           pad64[12];

You should check the way the compiler sees the user visible
structures with pahole - it shows up problems like this in an
obvious manner ;)

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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