lkml.org 
[lkml]   [2008]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] jffs2: Fix race condition in jffs2_lzo_compress()
From
Date

On Mon, 2008-11-03 at 17:17 +0100, Geert Uytterhoeven wrote:
> 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@linux.intel.com>

This should probably be queued as a bugfix for the current -rc series.

> ---
> Just noticed this when looking at the code.
> The patch is untested, except for a quick compile test.
>
> fs/jffs2/compr_lzo.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>




\
 
 \ /
  Last update: 2008-11-04 17:01    [W:0.090 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site