Re: [PATCH 1/2] make sure data is on disk before calling ->write_inode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 11 Jan 2010 18:30:47 +0100
Christoph Hellwig <hch@xxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux