On Thu, 2010-02-04 at 13:30 -0500, Christoph Hellwig wrote: > On Thu, Feb 04, 2010 at 11:20:16AM -0600, bpm@xxxxxxx wrote: > > > I think this is incorrect. datasync = 1 means to only write out > > > metadata that is required to access the file data. > > > > My thinking there was that the XFS wsync mount option would have ensured > > that the metadata that changed is already in the log. I wonder if when > > using the wsync xfs mount option, could one drop the vfs_fsync > > altogether? Looks to me like O_SYNC would also have taken care of any > > metadata that is required to access the file data. > > Indeed, both write_inode_now and vfs_fsync will also cause data to > be written. But my understanding of nfsd is that we manage the data > writeout separately anyway and we care about the metadata here, which > the placement of these calls would suggest: > > - nfsd_setattr for attribute updates > - nfsd_create for creating a new file (of any type) > - nfsd_link for adding a new link Yes. Most operations in NFS are required to be synchronous (the only exception being "unstable" write requests), and so those fsync/write_inode_now calls are there in order to ensure that the metadata and/or directory contents that were changed hits the disk before the RPC call completes. Cheers Trond -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html