From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [RFC] Bug in journal_commit_transaction? Date: Thu, 20 Apr 2006 19:51:01 +0200 Message-ID: <20060420175101.GC31972@atrey.karlin.mff.cuni.cz> References: <20060411133512.GE21928@atrey.karlin.mff.cuni.cz> <20060411182731.07541de2.akpm@osdl.org> <20060415210629.GA29171@atrey.karlin.mff.cuni.cz> <20060420084753.GA24993@atrey.karlin.mff.cuni.cz> <1145548837.3084.73.camel@orbit.scot.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , linux-fsdevel@vger.kernel.org Return-path: Received: from atrey.karlin.mff.cuni.cz ([195.113.31.123]:62952 "EHLO atrey.karlin.mff.cuni.cz") by vger.kernel.org with ESMTP id S1751199AbWDTRvC (ORCPT ); Thu, 20 Apr 2006 13:51:02 -0400 To: "Stephen C. Tweedie" Content-Disposition: inline In-Reply-To: <1145548837.3084.73.camel@orbit.scot.redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hello, > On Thu, 2006-04-20 at 10:47 +0200, Jan Kara wrote: > > > I've got no answer but I still think my argument was sound ;) Below > > is a patch also with a verbose comment what it fixes and how. > > Looks good to me, but it complicates the logic for this case and removes > some useful debug checks for conditions which are almost always true. > > Wouldn't it be better and safer just to make those almost-always true > conditions always true? We can do that pretty simply, just by > processing the t_forget list in two passes, always doing the bitmaps > last. (Though this will need care, as the list is potentially moving > under our feet...) > > Actually, scratch that, because journal_unmap_buffer() can return a > buffer to the committing transaction's forget list at any time, so we > really cannot guarantee to do all non-bitmaps first: new non-bitmaps > might arrive after we've started doing the bitmaps. Ugh. Thanks for looking into it. Yes, I agree that keeping that safety check would be nicer. But I was thinking for some time if we cannot somehow make sure that bitmaps are processed last but I didn't come up with anything useful. One possibility might be to do some magic in do_get_write_access() and get_create_access() if we find out we are reallocating buffer on forget list but I'm afraid that simple solutions (e.g. wait for commit) would harm performance which might be even worse... Honza -- Jan Kara SuSE CR Labs