From mboxrd@z Thu Jan 1 00:00:00 1970 From: Trond Myklebust Subject: Re: [PATCH 1/6] VFS: Ensure that writeback_single_inode() commits unstable writes Date: Fri, 08 Jan 2010 08:46:46 -0500 Message-ID: <1262958406.19319.4.camel@localhost> References: <20100106205110.22547.85345.stgit@localhost.localdomain> <20100106205110.22547.17971.stgit@localhost.localdomain> <20100107021849.GC9475@localhost> <1262839082.2185.15.camel@localhost> <20100107145635.GB20300@localhost> <1262877022.3309.11.camel@localhost> <20100108092542.GA27480@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Cc: Wu Fengguang , Peter Zijlstra , Jan Kara , Steve Rago , "linux-nfs@vger.kernel.org" , "jens.axboe" , Peter Staubach , Arjan van de Ven , Ingo Molnar , "linux-fsdevel@vger.kernel.org" To: Christoph Hellwig Return-path: Received: from mx2.netapp.com ([216.240.18.37]:58513 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753149Ab0AHNrU convert rfc822-to-8bit (ORCPT ); Fri, 8 Jan 2010 08:47:20 -0500 In-Reply-To: <20100108092542.GA27480@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, 2010-01-08 at 04:25 -0500, Christoph Hellwig wrote: > On Thu, Jan 07, 2010 at 10:10:22AM -0500, Trond Myklebust wrote: > > As I said previously, the write_inode() call is done _before_ you sync > > the dirty pages to the server, whereas commit_unstable_pages() wants to > > be done _after_ syncing. So the two are not the same, and we cannot > > replace commit_unstable_pages() with write_inode(). > > But that's more an accident of how this code was written. The right > order nees to be to write the pages first, then call write_inode. Most > modern filesystems have to work around this in their write_inode method > by waiting for the pages themselves. I already fixed the same ordering > issue in fsync, and the writeback code is next on the agenda. > Could we in that case replace write_inode() with something that takes a struct writeback_control? It is very useful to have full information about the write range and flags as it allows us to tweak the COMMIT RPC call. Trond