]> git.baikalelectronics.ru Git - kernel.git/commit
[JFFS2] fix race condition in jffs2_lzo_compress()
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Wed, 5 Nov 2008 22:21:16 +0000 (23:21 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 5 Nov 2008 22:22:02 +0000 (23:22 +0100)
commita00d6d401dce386db2984a97237d3f4521890ce8
tree2646065fd3b332e51af6d2c141833e6a00a7441b
parent5b3bd64fc9767d07bd98a3a126406130e5e0ac5f
[JFFS2] fix race condition in jffs2_lzo_compress()

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.

Cc: stable@kernel.org
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>
fs/jffs2/compr_lzo.c