]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
JFFS2: fix race condition in jffs2_lzo_compress()
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Fri, 7 Nov 2008 00:08:19 +0000 (00:08 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 13 Nov 2008 17:55:57 +0000 (09:55 -0800)
commita414c208c07d29b404d07665ea6ab1bc564ade42
tree9a896b0e59f9110879177ac57759b7caa473a63b
parent4ad8ad6f94ed1eb8abcb5a4001cef9da92bc84c2
JFFS2: fix race condition in jffs2_lzo_compress()

commit dc8a0843a435b2c0891e7eaea64faaf1ebec9b11 upstream

deflate_mutex protects the globals lzo_mem and lzo_compress_buf.  However,
jffs2_lzo_compress() unlocks deflate_mutex _before_ it has copied out the
compressed data from lzo_compress_buf.  Correct this by moving the mutex
unlock after the copy.

In addition, document what deflate_mutex actually protects.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Acked-by: Richard Purdie <rpurdie@openedhand.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/jffs2/compr_lzo.c