From patchwork Wed Nov 16 20:03:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Fasheh X-Patchwork-Id: 126028 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0494CB7134 for ; Thu, 17 Nov 2011 07:03:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751980Ab1KPUDM (ORCPT ); Wed, 16 Nov 2011 15:03:12 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49709 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751953Ab1KPUDL convert rfc822-to-8bit (ORCPT ); Wed, 16 Nov 2011 15:03:11 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id D5BAE8ADF6; Wed, 16 Nov 2011 21:03:10 +0100 (CET) Date: Wed, 16 Nov 2011 12:03:10 -0800 From: Mark Fasheh To: Chris Mason , Jan Kara , Christoph Hellwig , Steven Whitehouse , linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, jlbec@evilplan.org, cluster-devel@redhat.com Subject: Re: [Cluster-devel] fallocate vs O_(D)SYNC Message-ID: <20111116200310.GN23779@wotan.suse.de> Reply-To: Mark Fasheh References: <20111116084256.GA22963@infradead.org> <1321436588.2713.5.camel@menhir> <20111116105413.GA2916@quack.suse.cz> <20111116124550.GA11650@infradead.org> <20111116133915.GD8195@quack.suse.cz> <20111116134234.GA24258@infradead.org> <20111116155755.GA22284@quack.suse.cz> <20111116161806.GP29279@shiny> <20111116193540.GL23779@wotan.suse.de> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: <20111116193540.GL23779@wotan.suse.de> Organization: SUSE Labs User-Agent: Mutt/1.5.9i Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Nov 16, 2011 at 11:35:40AM -0800, Mark Fasheh wrote: > > We should do it per FS though, I'll patch up btrfs. > > I agree about doing it per FS. Ocfs2 just needs a one-liner to mark the > journal transaction as synchronous. Joel, here's an (untested) patch to fix this in Ocfs2. --Mark --- Mark Fasheh From: Mark Fasheh ocfs2: honor O_(D)SYNC flag in fallocate We need to sync the transaction which updates i_size if the file is marked as needing sync semantics. Signed-off-by: Mark Fasheh --- fs/ocfs2/file.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index de4ea1a..cac00b4 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1950,6 +1950,9 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, if (ret < 0) mlog_errno(ret); + if (file->f_flags & O_SYNC) + handle->h_sync = 1; + ocfs2_commit_trans(osb, handle); out_inode_unlock: