From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: Re: [PATCH] exofs: exofs_file_fsync correctness Date: Tue, 01 Jun 2010 18:40:46 +0300 Message-ID: <4C0529FE.6030901@panasas.com> References: <20100531100927.GA11149@lst.de> <4C0527AF.6090502@panasas.com> <20100601153414.GA15889@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, open-osd To: Christoph Hellwig Return-path: Received: from daytona.panasas.com ([67.152.220.89]:59425 "EHLO daytona.int.panasas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756924Ab0FAPkt (ORCPT ); Tue, 1 Jun 2010 11:40:49 -0400 In-Reply-To: <20100601153414.GA15889@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 06/01/2010 06:34 PM, Christoph Hellwig wrote: > On Tue, Jun 01, 2010 at 06:30:55PM +0300, Boaz Harrosh wrote: >> +/* exofs_file_fsync - flush the inode to disk >> + * >> + * @datasync is not used. All metadata is written in one place regardless. >> + * the writeout is synchronous >> + */ > > You still want to check it. It's really only need for checking the > various dirty flags in the inode, which you're still missing. > will do >> + struct writeback_control wbc = { >> + .sync_mode = WB_SYNC_ALL, >> + .nr_to_write = LONG_MAX, > > By setting a nr_to_write you still write out data (at least in theory). > So when do I also sync the data? is that done for me at the VFS layer? > I'd recommend just copying the code from generic_file_fsync.. > I was actually mimicking the code from nfs/write.c which has similar semantics as mine. And if so then I'll need to not reuse the above in .flush Boaz