* XFS warning in 2.6.18-rc4 @ 2006-08-09 20:04 Meelis Roos 2006-08-09 22:56 ` Nathan Scott 2006-08-09 23:06 ` Alexey Dobriyan 0 siblings, 2 replies; 7+ messages in thread From: Meelis Roos @ 2006-08-09 20:04 UTC (permalink / raw) To: nathans; +Cc: Linux Kernel list fs/xfs/xfs_bmap.c: In function 'xfs_bmapi': fs/xfs/xfs_bmap.c:2662: warning: 'rtx' is used uninitialized in this function -- Meelis Roos (mroos@linux.ee) ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: XFS warning in 2.6.18-rc4 2006-08-09 20:04 XFS warning in 2.6.18-rc4 Meelis Roos @ 2006-08-09 22:56 ` Nathan Scott 2006-08-10 23:47 ` Jesper Juhl 2006-08-09 23:06 ` Alexey Dobriyan 1 sibling, 1 reply; 7+ messages in thread From: Nathan Scott @ 2006-08-09 22:56 UTC (permalink / raw) To: Meelis Roos; +Cc: Linux Kernel list On Wed, Aug 09, 2006 at 11:04:53PM +0300, Meelis Roos wrote: > fs/xfs/xfs_bmap.c: In function 'xfs_bmapi': > fs/xfs/xfs_bmap.c:2662: warning: 'rtx' is used uninitialized in this function You have a particularly dense compiler, unfortunately. This code has always been this way, its just a false cc warning that can be safely ignored until you upgrade to a fixed compiler (unless I'm missing something - please enlighten me if so). It does seem to be the case that there is no way 'rtx' will be used uninitialised when xfs_rtpick_extent() doesn't fail... no? cheers. -- Nathan ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: XFS warning in 2.6.18-rc4 2006-08-09 22:56 ` Nathan Scott @ 2006-08-10 23:47 ` Jesper Juhl 2006-08-10 23:52 ` Nathan Scott 0 siblings, 1 reply; 7+ messages in thread From: Jesper Juhl @ 2006-08-10 23:47 UTC (permalink / raw) To: Nathan Scott; +Cc: Meelis Roos, Linux Kernel list On 10/08/06, Nathan Scott <nathans@sgi.com> wrote: > On Wed, Aug 09, 2006 at 11:04:53PM +0300, Meelis Roos wrote: > > fs/xfs/xfs_bmap.c: In function 'xfs_bmapi': > > fs/xfs/xfs_bmap.c:2662: warning: 'rtx' is used uninitialized in this function > > You have a particularly dense compiler, unfortunately. This code > has always been this way, its just a false cc warning that can be > safely ignored until you upgrade to a fixed compiler (unless I'm > missing something - please enlighten me if so). It does seem to > be the case that there is no way 'rtx' will be used uninitialised > when xfs_rtpick_extent() doesn't fail... no? > Ok, I may be reading something wrong here, but I think the warning is actually not correct. In fs/xfs/xfs_rtalloc.c::xfs_rtpick_extent() there is this code : ... if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, &ip))) return error; ... before anything even touches 'pick' (which is the last argument of type "xfs_rtblock_t *" which is what "&rtx" is being passed to that function as, from fs/xfs/xfs_bmap.c::xfs_bmap_rtalloc() at line 2659 before 'rtx' then used at line 2662. Look at this block of code from fs/xfs/xfs_bmap.c::xfs_bmap_rtalloc() : ... 2658: if (ap->eof && ap->off == 0) { 2659: error = xfs_rtpick_extent(mp, ap->tp, ralen, &rtx); 2660: if (error) 2661: return error; 2662: ap->rval = rtx * mp->m_sb.sb_rextsize; 2663: } else { 2664: ap->rval = 0; 2665: } .. 'rtx' has not been initialized in this function before this block of code. If the call to xfs_rtpick_extent() should happen to fail from the check quoted above, then 'rtx' will in fact be used uninitialized in line 2662 - except that will never happen, because if the check in In fs/xfs/xfs_rtalloc.c::xfs_rtpick_extent() fails then error will be != 0 and then well never get down to line 2662. Or am I missing something ? PS. Above line numbers etc are from 2.6.18-rc4. -- Jesper Juhl <jesper.juhl@gmail.com> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please http://www.expita.com/nomime.html ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: XFS warning in 2.6.18-rc4 2006-08-10 23:47 ` Jesper Juhl @ 2006-08-10 23:52 ` Nathan Scott 2006-08-11 0:02 ` Jesper Juhl 2006-08-15 3:46 ` David Chinner 0 siblings, 2 replies; 7+ messages in thread From: Nathan Scott @ 2006-08-10 23:52 UTC (permalink / raw) To: Jesper Juhl; +Cc: Meelis Roos, Linux Kernel list On Fri, Aug 11, 2006 at 01:47:43AM +0200, Jesper Juhl wrote: > On 10/08/06, Nathan Scott <nathans@sgi.com> wrote: > > On Wed, Aug 09, 2006 at 11:04:53PM +0300, Meelis Roos wrote: > > > fs/xfs/xfs_bmap.c: In function 'xfs_bmapi': > > > fs/xfs/xfs_bmap.c:2662: warning: 'rtx' is used uninitialized in this function > > > > You have a particularly dense compiler, unfortunately. This code > > has always been this way, its just a false cc warning that can be > > safely ignored until you upgrade to a fixed compiler (unless I'm > > missing something - please enlighten me if so). It does seem to > > be the case that there is no way 'rtx' will be used uninitialised > > when xfs_rtpick_extent() doesn't fail... no? > > > Ok, I may be reading something wrong here, but I think the warning is > actually not correct. Thats how I read it too. By "dense" I meant "buggy". > Or am I missing something ? Nope, thats my understanding too. The compiler is wrong in this case. The only open issue I guess is whether its worh rearranging the code to stop people reporting it as a problem... *shrug*. cheers. -- Nathan ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: XFS warning in 2.6.18-rc4 2006-08-10 23:52 ` Nathan Scott @ 2006-08-11 0:02 ` Jesper Juhl 2006-08-15 3:46 ` David Chinner 1 sibling, 0 replies; 7+ messages in thread From: Jesper Juhl @ 2006-08-11 0:02 UTC (permalink / raw) To: Nathan Scott; +Cc: Meelis Roos, Linux Kernel list On 11/08/06, Nathan Scott <nathans@sgi.com> wrote: > On Fri, Aug 11, 2006 at 01:47:43AM +0200, Jesper Juhl wrote: > > On 10/08/06, Nathan Scott <nathans@sgi.com> wrote: > > > On Wed, Aug 09, 2006 at 11:04:53PM +0300, Meelis Roos wrote: > > > > fs/xfs/xfs_bmap.c: In function 'xfs_bmapi': > > > > fs/xfs/xfs_bmap.c:2662: warning: 'rtx' is used uninitialized in this function > > > > > > You have a particularly dense compiler, unfortunately. This code > > > has always been this way, its just a false cc warning that can be > > > safely ignored until you upgrade to a fixed compiler (unless I'm > > > missing something - please enlighten me if so). It does seem to > > > be the case that there is no way 'rtx' will be used uninitialised > > > when xfs_rtpick_extent() doesn't fail... no? > > > > > Ok, I may be reading something wrong here, but I think the warning is > > actually not correct. > > Thats how I read it too. By "dense" I meant "buggy". > > > Or am I missing something ? > > Nope, thats my understanding too. The compiler is wrong in this case. > The only open issue I guess is whether its worh rearranging the code > to stop people reporting it as a problem... *shrug*. > I don't see how it would hurt ;) -- Jesper Juhl <jesper.juhl@gmail.com> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please http://www.expita.com/nomime.html ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: XFS warning in 2.6.18-rc4 2006-08-10 23:52 ` Nathan Scott 2006-08-11 0:02 ` Jesper Juhl @ 2006-08-15 3:46 ` David Chinner 1 sibling, 0 replies; 7+ messages in thread From: David Chinner @ 2006-08-15 3:46 UTC (permalink / raw) To: Nathan Scott; +Cc: Jesper Juhl, Meelis Roos, Linux Kernel list On Fri, Aug 11, 2006 at 09:52:10AM +1000, Nathan Scott wrote: > On Fri, Aug 11, 2006 at 01:47:43AM +0200, Jesper Juhl wrote: > > On 10/08/06, Nathan Scott <nathans@sgi.com> wrote: > > > On Wed, Aug 09, 2006 at 11:04:53PM +0300, Meelis Roos wrote: > > > > fs/xfs/xfs_bmap.c: In function 'xfs_bmapi': > > > > fs/xfs/xfs_bmap.c:2662: warning: 'rtx' is used uninitialized in this function > > > > > > You have a particularly dense compiler, unfortunately. This code > > > has always been this way, its just a false cc warning that can be > > > safely ignored until you upgrade to a fixed compiler (unless I'm > > > missing something - please enlighten me if so). It does seem to > > > be the case that there is no way 'rtx' will be used uninitialised > > > when xfs_rtpick_extent() doesn't fail... no? > > > > > Ok, I may be reading something wrong here, but I think the warning is > > actually not correct. > > Thats how I read it too. By "dense" I meant "buggy". > > > Or am I missing something ? > > Nope, thats my understanding too. The compiler is wrong in this case. > The only open issue I guess is whether its worh rearranging the code > to stop people reporting it as a problem... *shrug*. No, the compiler needs to be fixed. There are other warnings caused by code exactly like this that have not been fixed because it is an incorrect warning (e.g. "idx" in bio_alloc_bioset()). Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: XFS warning in 2.6.18-rc4 2006-08-09 20:04 XFS warning in 2.6.18-rc4 Meelis Roos 2006-08-09 22:56 ` Nathan Scott @ 2006-08-09 23:06 ` Alexey Dobriyan 1 sibling, 0 replies; 7+ messages in thread From: Alexey Dobriyan @ 2006-08-09 23:06 UTC (permalink / raw) To: Meelis Roos; +Cc: nathans, linux-kernel On Wed, Aug 09, 2006 at 11:04:53PM +0300, Meelis Roos wrote: > fs/xfs/xfs_bmap.c: In function 'xfs_bmapi': > fs/xfs/xfs_bmap.c:2662: warning: 'rtx' is used uninitialized in this function gcc bug again? Corresponding preprocessed source when XFS realtime allocator is off: static int xfs_bmap_rtalloc(xfs_bmalloca_t *ap) { ... xfs_rtblock_t rtx; ... if (ap->eof && ap->off == 0) { ===> error = (251); <=== if (error) return error; ap->rval = rtx * mp->m_sb.sb_rextsize; } else { ap->rval = 0; } This is the only place where rtx is "used". When realtime allocator is on, xfs_rtpick_extent() is real function either a) returning error and leaving garbage in "rtx", or b) initializing "rtx" and returning 0. ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-08-15 3:47 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-08-09 20:04 XFS warning in 2.6.18-rc4 Meelis Roos 2006-08-09 22:56 ` Nathan Scott 2006-08-10 23:47 ` Jesper Juhl 2006-08-10 23:52 ` Nathan Scott 2006-08-11 0:02 ` Jesper Juhl 2006-08-15 3:46 ` David Chinner 2006-08-09 23:06 ` Alexey Dobriyan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®