Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161049AbWLTX4g (ORCPT ); Wed, 20 Dec 2006 18:56:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161030AbWLTX4g (ORCPT ); Wed, 20 Dec 2006 18:56:36 -0500 Received: from smtp.osdl.org ([65.172.181.25]:50047 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161038AbWLTX43 (ORCPT ); Wed, 20 Dec 2006 18:56:29 -0500 Date: Wed, 20 Dec 2006 15:55:25 -0800 (PST) From: Linus Torvalds To: David Chinner cc: Martin Michlmayr , Peter Zijlstra , Hugh Dickins , Nick Piggin , Arjan van de Ven , Andrei Popa , Andrew Morton , Linux Kernel Mailing List , Florian Weimer , Marc Haber , Martin Schwidefsky , Heiko Carstens , Arnd Bergmann , gordonfarquharson@gmail.com Subject: Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3) In-Reply-To: <20061220232401.GB44411608@melbourne.sgi.com> Message-ID: References: <1166605296.10372.191.camel@twins> <1166607554.3365.1354.camel@laptopd505.fenrus.org> <1166614001.10372.205.camel@twins> <1166622979.10372.224.camel@twins> <20061220170323.GA12989@deprecation.cyrius.com> <20061220175309.GT30106@deprecation.cyrius.com> <20061220232401.GB44411608@melbourne.sgi.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1378 Lines: 34 On Thu, 21 Dec 2006, David Chinner wrote: > > XFS appears to call clear_page_dirty to get the mapping tree dirty > tag set correctly at the same time the page dirty flag is cleared. I > note that this can be done by set_page_writeback() if we clear the > dirty flag on the page first when we are writing back the entire page. Yes. I think the XFS routine should just use "clear_page_dirty_fir_io()", since that matches what it actually wants to do (surprise surprise, it's going to write it out). HOWEVER. Why is it conditional? Can somebody who understands XFS tell me why "clear_dirty" would ever be 0? I can grep the sources, and I see that it's an unconditional 1 in one call-site, but then in the other one it does xfs_start_page_writeback(page, wbc, !page_dirty, count); and that part just blows my mind. Why would you do a xfs_start_page_writeback() and _not_ write the page out? Is this for a partial-page-only case? Anyway, your patch looks fine. It seems to be the right thing to do. I'm just wondering why we're not always cleaning the whole page, and why we'd not set it unconditionally dirty? Linus - 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/