2013-07-07 09:55:01

by Stefan Richter

[permalink] [raw]
Subject: fs/ext4/inode.c::mpage_map_and_submit_extent - unused variable warning

Hi,

gcc 4.6.3 says:
fs/ext4/inode.c: In function ‘ext4_writepages’:
fs/ext4/inode.c:2219:6: warning: ‘err’ may be used uninitialized in this function [-Wuninitialized]
fs/ext4/inode.c:2161:6: note: ‘err’ was declared here

It would be an actual bug if mpage_map_and_submit_extent(handle, mpd, ...)
can be called with mpd->map.m_len == 0. Can it?
--
Stefan Richter
-=====-===-= -=== --===
http://arcgraph.de/sr/


2013-07-07 10:51:23

by Theodore Ts'o

[permalink] [raw]
Subject: Re: fs/ext4/inode.c::mpage_map_and_submit_extent - unused variable warning

On Sun, Jul 07, 2013 at 11:54:55AM +0200, Stefan Richter wrote:
> Hi,
>
> gcc 4.6.3 says:
> fs/ext4/inode.c: In function ‘ext4_writepages’:
> fs/ext4/inode.c:2219:6: warning: ‘err’ may be used uninitialized in this function [-Wuninitialized]
> fs/ext4/inode.c:2161:6: note: ‘err’ was declared here
>
> It would be an actual bug if mpage_map_and_submit_extent(handle, mpd, ...)
> can be called with mpd->map.m_len == 0. Can it?

It can't and we have a patch queued up to remove the warning.

Cheers,

- Ted