Adrian Bunk | 20 Aug 19:36
Picon
Favicon

2.6.13-rc6-mm1: git-ocfs2.patch breaks jffs

On Fri, Aug 19, 2005 at 04:33:31AM -0700, Andrew Morton wrote:
>...
> Changes since 2.6.13-rc5-mm1:
>...
>  git-ocfs2.patch
>...
>  Subsystem trees
>...

gcc correctly tells that at least a part of this patch incorrect (not 
that gcc says "is used", not "might be used"):

<--  snip  -->

...
  CC      fs/jffs/inode-v23.o
fs/jffs/inode-v23.c: In function 'jffs_create':
fs/jffs/inode-v23.c:1282: warning: 'inode' is used uninitialized in this function
...

<--  snip  -->

Looking at the code, it's trivial to verify that gcc is right.

cu
Adrian

--

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
(Continue reading)

Jesper Juhl | 21 Aug 00:28
Picon

use of uninitialized pointer in jffs_create()

gcc kindly pointed me at jffs_create() with this warning : 

fs/jffs/inode-v23.c:1279: warning: `inode' might be used uninitialized
in this function

And looking at the function :

static int
jffs_create(struct inode *dir, struct dentry *dentry, int mode,
                struct nameidata *nd)
{
        struct jffs_raw_inode raw_inode;
        struct jffs_control *c;
        struct jffs_node *node;
        struct jffs_file *dir_f; /* JFFS representation of the directory.  */
        struct inode *inode;
        int err;

        truncate_inode_pages(&inode->i_data, 0);
...

I think it is correct. How on earth is that call to
truncate_inode_pages() going to avoid blowing up? inode has not yet
been initialized... Looks like a bug to me.
Unfortunately I don't know anything about this code, so I haven't
attempted to fix it.

--

-- 
Jesper Juhl <jesper.juhl <at> gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
(Continue reading)

Alexey Dobriyan | 21 Aug 11:14
Picon

Re: use of uninitialized pointer in jffs_create()

On Sun, Aug 21, 2005 at 12:28:08AM +0200, Jesper Juhl wrote:
> gcc kindly pointed me at jffs_create() with this warning : 
> 
> fs/jffs/inode-v23.c:1279: warning: `inode' might be used uninitialized
> in this function

I don't see a warning with latest gcc-4.1 snapshot.

> And looking at the function :
> 
> static int
> jffs_create(struct inode *dir, struct dentry *dentry, int mode,
>                 struct nameidata *nd)
> {
>         struct jffs_raw_inode raw_inode;
>         struct jffs_control *c;
>         struct jffs_node *node;
>         struct jffs_file *dir_f; /* JFFS representation of the directory.  */
>         struct inode *inode;
>         int err;
> 
>         truncate_inode_pages(&inode->i_data, 0);

$ grep truncate_inode_pages -r fs/jffs/
$
	?

> I think it is correct. How on earth is that call to
> truncate_inode_pages() going to avoid blowing up? inode has not yet
> been initialized...
(Continue reading)

Jesper Juhl | 21 Aug 13:47
Picon

Re: use of uninitialized pointer in jffs_create()

On 8/21/05, Alexey Dobriyan <adobriyan <at> gmail.com> wrote:
> On Sun, Aug 21, 2005 at 12:28:08AM +0200, Jesper Juhl wrote:
> > gcc kindly pointed me at jffs_create() with this warning :
> >
> > fs/jffs/inode-v23.c:1279: warning: `inode' might be used uninitialized
> > in this function
> 
> I don't see a warning with latest gcc-4.1 snapshot.
> 

I'm using gcc 3.3.6, and the kernel that shows this warning is 2.6.13-rc6-mm1

--

-- 
Jesper Juhl <jesper.juhl <at> 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
Jörn Engel | 22 Aug 12:45
Picon

Re: use of uninitialized pointer in jffs_create()

On Sun, 21 August 2005 00:28:08 +0200, Jesper Juhl wrote:
> 
> gcc kindly pointed me at jffs_create() with this warning : 
> 
> fs/jffs/inode-v23.c:1279: warning: `inode' might be used uninitialized
> in this function

Real fix would be to finally remove that code.  Except for the usual
"change this function in the whole kernel" stuff, noone has touched it
for ages.

Jörn

--

-- 
Man darf nicht das, was uns unwahrscheinlich und unnatürlich erscheint,
mit dem verwechseln, was absolut unmöglich ist.
-- Carl Friedrich Gauß

To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo <at> axis.com

Stephane Wirtel | 22 Aug 07:21
Favicon

Re: use of uninitialized pointer in jffs_create()

Le Sunday 21 August 2005 a 13:08, Jesper Juhl ecrivait: 
> On 8/21/05, Alexey Dobriyan <adobriyan <at> gmail.com> wrote:
> > On Sun, Aug 21, 2005 at 12:28:08AM +0200, Jesper Juhl wrote:
> > > gcc kindly pointed me at jffs_create() with this warning :
> > >
> > > fs/jffs/inode-v23.c:1279: warning: `inode' might be used uninitialized
> > > in this function
> > 
> > I don't see a warning with latest gcc-4.1 snapshot.
> > 
> 
> I'm using gcc 3.3.6, and the kernel that shows this warning is 2.6.13-rc6-mm1
From a copy of the Linus's repository.
stephane <at> debian:~/devel/linux-2.6$ head -5 Makefile
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 13
EXTRAVERSION =-rc6
NAME=Woozy Numbat

stephane <at> debian:~/devel/linux-2.6/fs/jffs$ grep truncate * -rn
intrep.c:2452:             of the file system if a large file have been
truncated,
stephane <at> debian:~/devel/linux-2.6/fs/jffs$

Stephane

--

-- 
Stephane Wirtel <stephane.wirtel <at> belgacom.net>
                <stephane.wirtel <at> gmail.com>
(Continue reading)

Adrian Bunk | 23 Aug 01:07
Picon
Favicon

Re: use of uninitialized pointer in jffs_create()

On Mon, Aug 22, 2005 at 12:45:59PM +0200, Jörn Engel wrote:
> On Sun, 21 August 2005 00:28:08 +0200, Jesper Juhl wrote:
> > 
> > gcc kindly pointed me at jffs_create() with this warning : 
> > 
> > fs/jffs/inode-v23.c:1279: warning: `inode' might be used uninitialized
> > in this function
> 
> Real fix would be to finally remove that code.  Except for the usual
> "change this function in the whole kernel" stuff, noone has touched it
> for ages.

That's wrong, this -mm specific bug comes git-ocfs2.patch .

> Jörn

cu
Adrian

--

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

Jörn Engel | 23 Aug 11:07
Picon

Re: use of uninitialized pointer in jffs_create()

On Tue, 23 August 2005 01:07:58 +0200, Adrian Bunk wrote:
> On Mon, Aug 22, 2005 at 12:45:59PM +0200, Jörn Engel wrote:
> > On Sun, 21 August 2005 00:28:08 +0200, Jesper Juhl wrote:
> > > 
> > > gcc kindly pointed me at jffs_create() with this warning : 
> > > 
> > > fs/jffs/inode-v23.c:1279: warning: `inode' might be used uninitialized
> > > in this function
> > 
> > Real fix would be to finally remove that code.  Except for the usual
> > "change this function in the whole kernel" stuff, noone has touched it
> > for ages.
> 
> That's wrong, this -mm specific bug comes git-ocfs2.patch .

Ack.  If I wasn't this lazy, I'd still propose to completely remove
jffs - it's been old and deprecated for a few years already.

Jörn

--

-- 
Public Domain  - Free as in Beer
General Public - Free as in Speech
BSD License    - Free as in Enterprise
Shared Source  - Free as in "Work will make you..."

Gmane