Skip to content

Commit 6dac02a

Browse files
dedekindThomas Gleixner
authored andcommitted
[JFFS2] Fix slab panic
When JFFS22 is unable to read the root inode, the bad root inode object is not freed and remains sticked in the jffs2_i slab cache. When we further try to free the slab cache (e.g., on rmmod jffs2), slab allocator subsystem panics. Fix this bug. Signed-off-by: Artem B. Bityutskiy <dedekind@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 61a39b6 commit 6dac02a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎fs/jffs2/fs.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* For licensing information, see the file 'LICENCE' in this directory.
99
*
10-
* $Id: fs.c,v 1.58 2005/07/17 12:01:42 dedekind Exp $
10+
* $Id: fs.c,v 1.59 2005/07/18 11:21:19 dedekind Exp $
1111
*
1212
*/
1313

@@ -517,7 +517,7 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)
517517
root_i = iget(sb, 1);
518518
if (is_bad_inode(root_i)) {
519519
D1(printk(KERN_WARNING "get root inode failed\n"));
520-
goto out_nodes;
520+
goto out_root_i;
521521
}
522522

523523
D1(printk(KERN_DEBUG "jffs2_do_fill_super(): d_alloc_root()\n"));
@@ -535,7 +535,6 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)
535535

536536
out_root_i:
537537
iput(root_i);
538-
out_nodes:
539538
jffs2_free_ino_caches(c);
540539
jffs2_free_raw_node_refs(c);
541540
if (c->mtd->flags & MTD_NO_VIRTBLOCKS)

0 commit comments

Comments
 (0)