Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261731AbVAXXg6 (ORCPT ); Mon, 24 Jan 2005 18:36:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261741AbVAXXgR (ORCPT ); Mon, 24 Jan 2005 18:36:17 -0500 Received: from mx1.redhat.com ([66.187.233.31]:8939 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S261731AbVAXXfi (ORCPT ); Mon, 24 Jan 2005 18:35:38 -0500 Subject: Re: [Ext2-devel] [PATCH] JBD: journal_release_buffer() From: "Stephen C. Tweedie" To: Alex Tomas Cc: linux-kernel , "ext2-devel@lists.sourceforge.net" , Andrew Morton , Stephen Tweedie In-Reply-To: References: <1106604342.2103.395.camel@sisko.sctweedie.blueyonder.co.uk> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1106609725.2103.616.camel@sisko.sctweedie.blueyonder.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-9) Date: Mon, 24 Jan 2005 23:35:26 +0000 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1155 Lines: 29 Hi, On Mon, 2005-01-24 at 22:24, Alex Tomas wrote: > hmmm. that's a good catch. so, with this patch A increments h_buffer_credits > and this one will go to the t_outstanding_credits while the buffer is still > part of the transaction. indeed, an imbalance. > > probably something like the following would be enough? > > + /* return credit back to the handle if it was really spent */ > + if (credits) { > + handle->h_buffer_credits++; > + spin_lock(&handle->h_transaction->t_handle_lock); > + handle->h_transaction->t_outstanding_credits++; > + spin_lock(&handle->h_transaction->t_handle_lock); > + } That returns the credit to A (satisfying ext3), but you just grew t_outstanding_credits, thus growing the journal commitments without checking if it's safe to do so or being able to handle failure. So it just reintroduces the original bug. --Stephen - 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/