From: Eric Sandeen Subject: Re: [PATCH] ext3: wait on all pending commits in ext3_sync_fs Date: Thu, 18 Dec 2008 17:37:23 -0600 Message-ID: <494ADEB3.8010109@redhat.com> References: <4908C951.2000309@redhat.com> <20081103184426.GA31894@ajones-laptop.nbttech.com> <20081103113318.35b0c266.akpm@linux-foundation.org> <20081103201428.GB30565@ajones-laptop.nbttech.com> <20081218231707.GB20092@atrey.karlin.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Arthur Jones , Andrew Morton , "linux-ext4@vger.kernel.org" , "sct@redhat.com" , "linux-kernel@vger.kernel.org" To: Jan Kara Return-path: Received: from mx2.redhat.com ([66.187.237.31]:59839 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026AbYLRXhi (ORCPT ); Thu, 18 Dec 2008 18:37:38 -0500 In-Reply-To: <20081218231707.GB20092@atrey.karlin.mff.cuni.cz> Sender: linux-ext4-owner@vger.kernel.org List-ID: Jan Kara wrote: > Hello, > > I'm sorry I'm replying late but I got time to react to this only now... > >> I tried this and it too fixes the problem. FWIW I agree it >> looks better... > Well, shouldn't we rather fix what journal_start_commit() returns? > The interface which returns 1 when a transaction is already committing or > a transaction commit has just been started but 0 when we race with > somebody staring the commit is fairly unusable. Moreover > ext3_force_commit() will unnecessarily create new sync transaction and > commit it if there's no transaction running which is quite expensive > (even merging empty sync handle is not for free because of sync > transaction batching). But this is minor problem since we probably > don't care too much about sync() performance - BTW this is probably a > cause for bug 12224, isn't it? Yep, it is! :) > BTW: ocfs2 would need fixing as well if done your way since it's > sync_fs function has been copied over from ext3. > To summarized I'd rather see a patch like below (untested) going in > and your patch reverted... Opinions? I can cookup a JBD2 version of > the patch in case we agree to go this way. Thanks, I'll look that over. In looking at what we have today, I wonder if we can make things smarter so that we don't commit empty transactions in any case? -Eric