cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Joel Becker <jlbec@evilplan.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] fallocate vs O_(D)SYNC
Date: Thu, 17 Nov 2011 02:16:36 -0800	[thread overview]
Message-ID: <20111117101635.GG7319@noexit.corp.google.com> (raw)
In-Reply-To: <20111116200310.GN23779@wotan.suse.de>

On Wed, Nov 16, 2011 at 12:03:10PM -0800, Mark Fasheh wrote:
> 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 <mfasheh@suse.com>
> 
> 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 <mfasheh@suse.de>

	Makes sense to me.  

Joel

> ---
>  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:
> -- 
> 1.7.6
> 

-- 

Life's Little Instruction Book #347

	"Never waste the oppourtunity to tell someone you love them."

			http://www.jlbec.org/
			jlbec at evilplan.org



  parent reply	other threads:[~2011-11-17 10:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16  8:42 [Cluster-devel] fallocate vs O_(D)SYNC Christoph Hellwig
2011-11-16  9:43 ` Steven Whitehouse
2011-11-16 10:54   ` Jan Kara
2011-11-16 11:20     ` Steven Whitehouse
2011-11-16 12:45     ` Christoph Hellwig
2011-11-16 13:39       ` Jan Kara
2011-11-16 13:42         ` Christoph Hellwig
2011-11-16 15:57           ` Jan Kara
2011-11-16 16:16             ` Christoph Hellwig
     [not found]             ` <20111116161806.GP29279@shiny>
     [not found]               ` <20111116193540.GL23779@wotan.suse.de>
     [not found]                 ` <20111116200310.GN23779@wotan.suse.de>
2011-11-17 10:16                   ` Joel Becker [this message]
2011-11-18 12:09             ` Steven Whitehouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111117101635.GG7319@noexit.corp.google.com \
    --to=jlbec@evilplan.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).