Skip to contentSkip to conversation

bugreport

DISCUSSION Artem B. Bityuckiy 3 participants 6 messages Jul 27, 2004 – Jul 29, 2004 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hello.

There is a bug in jffs2 module registration function - super.c line 293:
the init_jffs2_fs function doesn't properly perform
the de-initialization in case of failures on lines 315 and 321. The jffs2_inode_cachep is also not feed.

I Tried to send a patch bit mailman soesn't gieve me...

Signature · 3 lines
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
#1 lore raw
Quoted 8 lines · Artem B. Bityuckiy

Hello.

There is a bug in jffs2 module registration function - super.c line 293:
the init_jffs2_fs function doesn't properly perform
the de-initialization in case of failures on lines 315 and 321. The jffs2_inode_cachep is also not feed.

I Tried to send a patch bit mailman soesn't gieve me...

I think you meant that one, right ?

Thanks, fixed in CVS

tglx

@@ -330,6 +330,7 @@
out_compressors:

        jffs2_compressors_exit();
  out:
+       kmem_cache_destroy(jffs2_inode_cachep);
        return ret;

}

#2 lore raw
Quoted 20 lines · Thomas Gleixner
Quoted 8 lines · Artem B. Bityuckiy

Hello.

There is a bug in jffs2 module registration function - super.c line 293:
the init_jffs2_fs function doesn't properly perform
the de-initialization in case of failures on lines 315 and 321. The jffs2_inode_cachep is also not feed.

I Tried to send a patch bit mailman soesn't gieve me...

I think you meant that one, right ?

Thanks, fixed in CVS

tglx

Review line 336

Quoted 7 lines
(quoted diff) +1 -0
@@ -330,6 +330,7 @@
  out_compressors:
        jffs2_compressors_exit();
  out:
+       kmem_cache_destroy(jffs2_inode_cachep);
        return ret;
 }
 

Not only. The "go out" in case of jffs2_compressors_init() failure doesn't free /proc resources...

I tried to send the following patch as the attached file (now I'll try to just insert the text):

-- super.c 2004-07-18 18:44:42.000000000 +0400
+++ /home/dedekind/tmp/super_fixed.c 2004-07-26 15:05:34.000000000 +0400
@@ -318,7 +318,7 @@
ret =
if (ret) {
printk(KERN_ERR "JFFS2 error: Failed to initialise compressors\n");
- goto out;
+ goto out_proc;
}
ret = jffs2_create_slab_caches();
if (ret) {
@@ -336,10 +336,12 @@
jffs2_destroy_slab_caches();
out_compressors:
jffs2_compressors_exit();
+ out_proc:

 #ifdef CONFIG_JFFS2_PROC
         jffs2_proc_exit();

#endif
out:
+ kmem_cache_destroy(jffs2_inode_cachep);
return ret;
}

Note - the patch is just to show the problem and doesn't pretent to be applied as is.

Signature · 3 lines
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
#3 lore raw
Quoted 2 lines · Artem B. Bityuckiy

Not only. The "go out" in case of jffs2_compressors_init() failure doesn't free /proc resources...

proc support was removed in meantime (current CVS). But anyway thanks for pointing this out

tglx

#4 lore raw
Quoted 2 lines · Thomas Gleixner

On Tue, 2004-07-27 at 16:40, Artem B. Bityuckiy wrote:
proc support was removed in meantime (current CVS).

Oh, sorry, my snapshot was deprecated.

Note, the same thing should also be fixed in super-v24.c.

Just interesting, why the proc interface was removed? Have you added ioctl interface? My JFFS2 CVS snapshot of 15 Jul 2004 has no ioctl interface.

Quoted 1 line

But anyway thanks for pointing this out

Not at all.

Signature · 3 lines
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
#5 lore raw
Quoted 3 lines · Artem B. Bityuckiy

Just interesting, why the proc interface was removed? Have you added ioctl interface? My JFFS2 CVS snapshot of 15 Jul 2004 has no ioctl interface.

Al Viro took a brief look at it and used lots of nasty works. So I removed it.

Signature · 1 line
dwmw2