public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* bugreport
@ 2004-07-26 11:16 Artem Bityuckiy
  0 siblings, 0 replies; 7+ messages in thread
From: Artem Bityuckiy @ 2004-07-26 11:16 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

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.

The proposed patch is attached.

Note 1: I didn't test this patch and didn't even compile JFFS2 with it - 
*be careful*.

Note 2: The similar ought to be fixed in super-v24.c

Artem.

-- 
Best regards, Artem B. Bityuckiy
Oktet Labs (St. Petersburg), Software Engineer.
+78124286709 (office) +79112449030 (mobile)
E-mail: dedekind@oktetlabs.ru, web: http://www.oktetlabs.ru

[-- Attachment #2: super.c.diff --]
[-- Type: text/plain, Size: 592 bytes --]

--- 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 = jffs2_compressors_init();
 	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;
 }
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bugreport
@ 2004-07-27 13:08 Artem B. Bityuckiy
  2004-07-27 13:22 ` bugreport Thomas Gleixner
  0 siblings, 1 reply; 7+ messages in thread
From: Artem B. Bityuckiy @ 2004-07-27 13:08 UTC (permalink / raw)
  To: linux-mtd

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...

-- 
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bugreport
  2004-07-27 13:08 bugreport Artem B. Bityuckiy
@ 2004-07-27 13:22 ` Thomas Gleixner
  2004-07-27 14:40   ` bugreport Artem B. Bityuckiy
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Gleixner @ 2004-07-27 13:22 UTC (permalink / raw)
  To: Artem B. Bityuckiy; +Cc: David Woodhouse, linux-mtd

On Tue, 2004-07-27 at 15:08, Artem B. Bityuckiy wrote:
> 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;
 }

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bugreport
  2004-07-27 13:22 ` bugreport Thomas Gleixner
@ 2004-07-27 14:40   ` Artem B. Bityuckiy
  2004-07-27 17:31     ` bugreport Thomas Gleixner
  0 siblings, 1 reply; 7+ messages in thread
From: Artem B. Bityuckiy @ 2004-07-27 14:40 UTC (permalink / raw)
  To: tglx; +Cc: David Woodhouse, linux-mtd



Thomas Gleixner wrote:
> On Tue, 2004-07-27 at 15:08, Artem B. Bityuckiy wrote:
> 
>>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;
>  }
> 
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.

-- 
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bugreport
  2004-07-27 14:40   ` bugreport Artem B. Bityuckiy
@ 2004-07-27 17:31     ` Thomas Gleixner
  2004-07-28  6:41       ` bugreport Artem B. Bityuckiy
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Gleixner @ 2004-07-27 17:31 UTC (permalink / raw)
  To: Artem B. Bityuckiy; +Cc: linux-mtd, David Woodhouse

On Tue, 2004-07-27 at 16:40, Artem B. Bityuckiy wrote:
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bugreport
  2004-07-27 17:31     ` bugreport Thomas Gleixner
@ 2004-07-28  6:41       ` Artem B. Bityuckiy
  2004-07-29 19:56         ` bugreport David Woodhouse
  0 siblings, 1 reply; 7+ messages in thread
From: Artem B. Bityuckiy @ 2004-07-28  6:41 UTC (permalink / raw)
  To: linux-mtd

Thomas Gleixner wrote:
> 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.

> But anyway thanks for pointing this out
Not at all.

-- 
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bugreport
  2004-07-28  6:41       ` bugreport Artem B. Bityuckiy
@ 2004-07-29 19:56         ` David Woodhouse
  0 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2004-07-29 19:56 UTC (permalink / raw)
  To: Artem B. Bityuckiy; +Cc: linux-mtd

On Wed, 2004-07-28 at 10:41 +0400, Artem B. Bityuckiy wrote:
> 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.

-- 
dwmw2

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-07-29 19:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-27 13:08 bugreport Artem B. Bityuckiy
2004-07-27 13:22 ` bugreport Thomas Gleixner
2004-07-27 14:40   ` bugreport Artem B. Bityuckiy
2004-07-27 17:31     ` bugreport Thomas Gleixner
2004-07-28  6:41       ` bugreport Artem B. Bityuckiy
2004-07-29 19:56         ` bugreport David Woodhouse
  -- strict thread matches above, loose matches on Subject: below --
2004-07-26 11:16 bugreport Artem Bityuckiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox