From: Geert Uytterhoeven Date: Fri, 7 Nov 2008 00:08:19 +0000 (+0000) Subject: JFFS2: fix race condition in jffs2_lzo_compress() X-Git-Tag: v2.6.27.6~33 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a414c208c07d29b404d07665ea6ab1bc564ade42;p=pandora-kernel.git 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 Acked-by: Richard Purdie Signed-off-by: Andrew Morton Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed