linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Christoph Hellwig <hch@lst.de>
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
	Trond.Myklebust@netapp.com, dhowells@redhat.com
Subject: Re: [PATCH 1/2] make sure data is on disk before calling ->write_inode
Date: Wed, 13 Jan 2010 16:21:54 -0800	[thread overview]
Message-ID: <20100113162154.f7e7af49.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100111173047.GA6852@lst.de>

On Mon, 11 Jan 2010 18:30:47 +0100
Christoph Hellwig <hch@lst.de> wrote:

> --- linux-2.6.orig/fs/fs-writeback.c	2010-01-11 15:53:15.462272627 +0100
> +++ linux-2.6/fs/fs-writeback.c	2010-01-11 15:54:09.662006283 +0100
> @@ -461,15 +461,20 @@ writeback_single_inode(struct inode *ino
>  
>  	ret = do_writepages(mapping, wbc);
>  
> -	/* Don't write the inode if only I_DIRTY_PAGES was set */
> -	if (dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
> -		int err = write_inode(inode, wait);
> +	/*
> +	 * Make sure to wait on the data before writing out the metadata.
> +	 * This is important for filesystems that modify metadata on data
> +	 * I/O completion.
> +	 */
> +	if (wait) {
> +		int err = filemap_fdatawait(mapping);
>  		if (ret == 0)
>  			ret = err;
>  	}
>  
> -	if (wait) {
> -		int err = filemap_fdatawait(mapping);
> +	/* Don't write the inode if only I_DIRTY_PAGES was set */
> +	if (dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
> +		int err = write_inode(inode, wait);
>  		if (ret == 0)
>  			ret = err;
>  	}

hm, yeah, it's hard to see how this reordering can harm throughput much.

nfs_write_inode() has vanished in linux-enxt so I just dropped all the
nfs parts of these two patches.  You might want to check that.

  parent reply	other threads:[~2010-01-14  0:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-11 17:30 [PATCH 1/2] make sure data is on disk before calling ->write_inode Christoph Hellwig
2010-01-12  0:41 ` Dave Chinner
2010-01-14  0:21 ` Andrew Morton [this message]
2010-01-14  6:21   ` Christoph Hellwig

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=20100113162154.f7e7af49.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=dhowells@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).