On Fri, 26 Oct 2012 17:06:55 -0400 "J. Bruce Fields" <bfields@xxxxxxxxxx> wrote: > From: "J. Bruce Fields" <bfields@xxxxxxxxxx> > > Peter pointed out to me that the nfs server is implementing stable > writes by setting the O_SYNC flag. I can't see why we couldn't write > and then sync instead, but I don't know this stuff as well as I should; > does the following look reasonable to people? Bruce changed the code to implement stable writes by calling vfs_fsync_range(). I can't see why we couldn't use O_SYNC instead. It seems like you are making a change just for the sake of making a change. Is there some reason that you think a separate 'sync' is more efficient than using O_SYNC ? As a general principle, I think it is best to give the file system as much information as possible to that it can make whatever optimisation decisions that it wants to. Setting O_SYNC gives the filesystem more information than not, because it allows it to change the behaviour of the 'write' request... though I don't know if any filesystem actually uses the information. Why the change? NeilBrown > > --b. > > J. Bruce Fields (2): > nfsd: assume writeable exportabled filesystems have f_sync > nfsd: use vfs_fsync_range(), not O_SYNC, for stable writes > > fs/nfsd/vfs.c | 26 ++++++-------------------- > 1 file changed, 6 insertions(+), 20 deletions(-) >
Attachment:
signature.asc
Description: PGP signature