xfs
[Top] [All Lists]

Re: [PATCH] xfs_db: check on-disk structure sizes

To: xfs@xxxxxxxxxxx
Subject: Re: [PATCH] xfs_db: check on-disk structure sizes
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Tue, 12 Jan 2016 21:10:23 -0600
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160113012945.GC2455@xxxxxxxxxxxxxxxx>
References: <20160111234644.GB7831@xxxxxxxxxxxxxxxx> <20160112140122.GC12156@xxxxxxxxxxxxxxx> <20160113012945.GC2455@xxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 1/12/16 7:29 PM, Darrick J. Wong wrote:
> On Tue, Jan 12, 2016 at 09:01:22AM -0500, Brian Foster wrote:
>> On Mon, Jan 11, 2016 at 03:46:44PM -0800, Darrick J. Wong wrote:
>>> Check on-disk structure sizes against known values.
>>> 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>
>>> ---
>>
>> What's the need for this in userspace? Not a big deal really, but it
>> seems like it serves the fundamental purpose sufficiently in the kernel.
> 
> The primary point is to make sure that we didn't make any errors with the
> on-disk structures when porting libxfs changes.  The kernel build is the first
> line of defense since it tends to big get changes first, but I figure a
> defensive build check for xfsprogs won't harm anyone...

Does it need to actually be in the code?

$ pahole -s fs/xfs/xfs.ko | grep -w "xfs_dsb\|xfs_agf\|xfs_agi\|xfs_agfl"
xfs_agf 224     0
xfs_agfl        40      0
xfs_agi 336     0
xfs_dsb 264     0

pahole needs a binary w/ debuginfo, but maybe this could just be hooked up
in the Makefiles?

-Eric

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