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

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

 



ping?  this fixes a quite nasty issue introduced in 2.6.32, so we should
fix it ASAP (including backport to -stable)

On Fri, Dec 25, 2009 at 05:44:45PM +0100, Christoph Hellwig wrote:
> nfsd is not using vfs_fsync, so I missed it when changing the calling
> convention during the 2.6.32 window.  This patch fixes it to not only
> start the data writeout, but also wait for it to complete before calling
> into ->fsync.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> 
> Index: linux-2.6/fs/nfsd/vfs.c
> ===================================================================
> --- linux-2.6.orig/fs/nfsd/vfs.c	2009-12-25 17:21:32.371024157 +0100
> +++ linux-2.6/fs/nfsd/vfs.c	2009-12-25 17:31:39.644006085 +0100
> @@ -780,12 +780,9 @@ static inline int nfsd_dosync(struct fil
>  	int (*fsync) (struct file *, struct dentry *, int);
>  	int err;
>  
> -	err = filemap_fdatawrite(inode->i_mapping);
> +	err = filemap_write_and_wait(inode->i_mapping);
>  	if (err == 0 && fop && (fsync = fop->fsync))
>  		err = fsync(filp, dp, 0);
> -	if (err == 0)
> -		err = filemap_fdatawait(inode->i_mapping);
> -
>  	return err;
>  }
>  
---end quoted text---
--
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