2009-02-09 11:16:23

by bugme-daemon

[permalink] [raw]
Subject: [Bug 12676] New: fs/ext4/extents.c: In function ‘ext4 ext search right’: fs/ext4/extents.c:1120: warning: ‘ix’ may be used uninitialized in this function

http://bugzilla.kernel.org/show_bug.cgi?id=12676

Summary: fs/ext4/extents.c: In function
‘ext4_ext_search_right’: fs/ext4/extents.c:1120:
warning: ‘ix’ may be used uninitialized in this
function
Product: File System
Version: 2.5
KernelVersion: 2.6.28.4
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: ext4
AssignedTo: [email protected]
ReportedBy: [email protected]


Latest working kernel version:2.6.29-rc2
Earliest failing kernel version:2.6.29rc3
Distribution:Debian Sid
Hardware Environment:Imac G3 600mhz 640MB RAM, 40GB Hard drive
Software Environment:?
Problem Description:
When compiling gets this error on Ext4 FS:
"fs/ext4/extents.c: In function ‘ext4_ext_search_right’:
fs/ext4/extents.c:1120: warning: ‘ix’ may be used uninitialized in this
function
"

Steps to reproduce:Compile kernel with Ext4


--
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


2009-02-09 16:10:47

by bugme-daemon

[permalink] [raw]
Subject: [Bug 12676] fs/ext4/extents.c: In function ‘ext4 ext search right’: fs/ext4/extents.c:1120: warning: ‘ix’ may be used uninitialized in this function

http://bugzilla.kernel.org/show_bug.cgi?id=12676





------- Comment #1 from [email protected] 2009-02-09 08:10 -------
I think this is fixed upstream; you say in the bug metadata that this is
version 2.6.28.4 but the first comment says 2.6.29-rc* - which is it?


--
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

2009-02-10 18:21:32

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [Bug 12676] New: fs/ext4 /extents.c: In function ‘ext4 ext search right’: fs/ext4/extents.c:1120: warning: ‘ix’ may be used uninitialized in this function

On Mon, Feb 09, 2009 at 03:15:49AM -0800, [email protected] wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=12676
>
> Summary: fs/ext4/extents.c: In function
> ‘ext4_ext_search_right’: fs/ext4/extents.c:1120:
> warning: ‘ix’ may be used uninitialized in this
> function

> When compiling gets this error on Ext4 FS:
> "fs/ext4/extents.c: In function ‘ext4_ext_search_right’:
> fs/ext4/extents.c:1120: warning: ‘ix’ may be used uninitialized in this
> function
> "

What version of gcc are you using to compile your kernel? This looks
like the case of "gcc is stupid not to notice that depth must be
non-zero, so ix is always initialized". Which doesn't seem to be the
case with gcc 4.3.2, but it might be true with an older version of
gcc.

We can shut up gcc by forcibly initializing ix, but if this is only a
problem with older gcc's, as it seems, it's probably best not to
clutter the source (and the compiled binary) with an unneeded
initialization:

/* go up and search for index to the right */
while (--depth >= 0) {
ix = path[depth].p_idx;
if (ix != EXT_LAST_INDEX(path[depth].p_hdr))
goto got_index;
}

/* we've gone up to the root and found no index to the right */
return 0;

got_index:
/* we've found index to the right, let's
* follow it and find the closest allocated
* block to the right */
ix++;
^^^^^ Gee, aren't (some verions of) gcc stupid?


- Ted

2009-02-10 18:22:08

by bugme-daemon

[permalink] [raw]
Subject: [Bug 12676] fs/ext4/extents.c: In function ‘ext4 ext search right’: fs/ext4/extents.c:1120: warning: ‘ix’ may be used uninitialized in this function

http://bugzilla.kernel.org/show_bug.cgi?id=12676





------- Comment #2 from [email protected] 2009-02-10 10:21 -------
On Mon, Feb 09, 2009 at 03:15:49AM -0800, [email protected]
wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=12676
>
> Summary: fs/ext4/extents.c: In function
> ‘ext4_ext_search_right’: fs/ext4/extents.c:1120:
> warning: ‘ix’ may be used uninitialized in this
> function

> When compiling gets this error on Ext4 FS:
> "fs/ext4/extents.c: In function ‘ext4_ext_search_right’:
> fs/ext4/extents.c:1120: warning: ‘ix’ may be used uninitialized in this
> function
> "

What version of gcc are you using to compile your kernel? This looks
like the case of "gcc is stupid not to notice that depth must be
non-zero, so ix is always initialized". Which doesn't seem to be the
case with gcc 4.3.2, but it might be true with an older version of
gcc.

We can shut up gcc by forcibly initializing ix, but if this is only a
problem with older gcc's, as it seems, it's probably best not to
clutter the source (and the compiled binary) with an unneeded
initialization:

/* go up and search for index to the right */
while (--depth >= 0) {
ix = path[depth].p_idx;
if (ix != EXT_LAST_INDEX(path[depth].p_hdr))
goto got_index;
}

/* we've gone up to the root and found no index to the right */
return 0;

got_index:
/* we've found index to the right, let's
* follow it and find the closest allocated
* block to the right */
ix++;
^^^^^ Gee, aren't (some verions of) gcc stupid?


- Ted


--
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

2009-05-19 18:35:59

by bugzilla-daemon

[permalink] [raw]
Subject: [Bug 12676] fs/ext4/extents.c: In function ‘ext4_ext_search_right’ : fs/ext4/extents.c:1120: warning: ‘ix’ may be used uninitialized in this function

http://bugzilla.kernel.org/show_bug.cgi?id=12676


Theodore Tso <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |[email protected]
Resolution| |UNREPRODUCIBLE
Regression|--- |No




--- Comment #3 from Theodore Tso <[email protected]> 2009-05-19 18:36:00 ---
No response from the person filing the bug, and I don't see any compiler
warnings gcc 4.3.x, so I'm closing this bug.

--
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.