xfs
[Top] [All Lists]

Re: xfs_repair: add printf format checking and fix the fallout

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: xfs_repair: add printf format checking and fix the fallout
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 30 Aug 2011 15:22:26 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20110829083852.GA31515@xxxxxxxxxxxxx>
References: <20110814201239.GA26453@xxxxxxxxxxxxx> <20110829083852.GA31515@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Aug 29, 2011 at 04:38:52AM -0400, Christoph Hellwig wrote:
> ping?
> 
> On Sun, Aug 14, 2011 at 04:12:39PM -0400, Christoph Hellwig wrote:
> > Add the gcc printf like attribute to the xfs_repair-internal logging 
> > helpers,
> > and fix the massive fallout.  A large part of it is dealing with the correct
> > format for fixed size 64-bit types, but there were a lot of real bug in 
> > there,
> > including some that lead to crashed when repairing certain corrupted
> > filesystems on ARM based systems.
> > 
> > Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> > Reported-by: Anisse Astier <anisse@xxxxxxxxx>

I see these new warnings after applying the patch on x86-64:

phase6.c: In function "shortform_dir_entry_check":
phase6.c:2737:4: warning: format "%llu" expects argument of type "long long 
unsigned int", but argument 3 has type "xfs_ino_t" [-Wformat]
phase6.c:2737:4: warning: format "%llu" expects argument of type "long long 
unsigned int", but argument 4 has type "xfs_ino_t" [-Wformat]
phase6.c: In function "shortform_dir2_entry_check":
phase6.c:3066:4: warning: format "%llu" expects argument of type "long long 
unsigned int", but argument 3 has type "xfs_ino_t" [-Wformat]
phase6.c:3066:4: warning: format "%llu" expects argument of type "long long 
unsigned int", but argument 4 has type "xfs_ino_t" [-Wformat]

The warnings do not appear on i686.

Otherwise, I've scanned the changes after checking what most of the
conversions are (e.g. %llu -> PRIU64 for inode numbers) and I didn't
see any obvious errors (but then again my eyes glazed over a bit
after the first 2000 lines of the patch). I haven't seen any runtime
changes, either, so if you fix the above warning as well, then
consider this:

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx

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