]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[JFFS2] Fix the slab cache constructor of 'struct jffs2_inode_info' objects.
authorThomas Gleixner <tglx@mtd.linutronix.de>
Tue, 29 Nov 2005 15:57:17 +0000 (16:57 +0100)
committerThomas Gleixner <tglx@mtd.linutronix.de>
Tue, 29 Nov 2005 15:57:17 +0000 (16:57 +0100)
commit21eeb7aa116b1f59fc23339521173cbb13e57f1a
treeaca16132a18dca8c8bf3417d118ad9d98834db32
parentbc4117f8767203927e78b92e9e5b3ddb71d6a84d
[JFFS2] Fix the slab cache constructor of 'struct jffs2_inode_info' objects.

JFFS2 initialize f->sem mutex as "locked" in the slab constructor which is a
bug. Objects are freed with unlocked f->sem mutex. So, when they allocated
again, f->sem is unlocked because the slab cache constructor is not called for
them. The constructor is called only once when memory pages are allocated for
objects (namely, when the slab layer allocates new slabs). So, sometimes
'struct jffs2_inode_info' are allocated with unlocked f->sem, sometimes with
locked. This is a bug. Instead, initialize f->sem as unlocked in the
constructor. I.e., in the "constructed" state f->sem must be unlocked.

From: Keijiro Yano <keijiro_yano@yahoo.co.jp>
Acked-by: Artem B. Bityutskiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
fs/jffs2/fs.c
fs/jffs2/super.c