Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756361AbYKDP6c (ORCPT ); Tue, 4 Nov 2008 10:58:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755973AbYKDP5p (ORCPT ); Tue, 4 Nov 2008 10:57:45 -0500 Received: from 3a.49.1343.static.theplanet.com ([67.19.73.58]:57414 "EHLO pug.o-hand.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755968AbYKDP5n (ORCPT ); Tue, 4 Nov 2008 10:57:43 -0500 Subject: Re: [PATCH] jffs2: Fix race condition in jffs2_lzo_compress() From: Richard Purdie To: Geert Uytterhoeven Cc: David Woodhouse , linux-mtd@lists.infradead.org, Linux Kernel Development In-Reply-To: References: Content-Type: text/plain Date: Tue, 04 Nov 2008 15:57:40 +0000 Message-Id: <1225814260.5433.13.camel@dax.rpnet.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1033 Lines: 28 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 Acked-by: Richard Purdie 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(-) > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/