aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-12-25 11:44:45 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2010-01-06 17:37:26 -0500
commit7211a4e859ad070b28545c06e0a6cb60b3b8aa31 (patch)
tree2a769132446f73cf593661428e68d7086168a5b2 /fs
parentf69ac2f5a36948e1adf071074414c5d1907b89b7 (diff)
nfsd: make sure data is on disk before calling ->fsync
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@lst.de> Cc: stable@kernel.org Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/vfs.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index e3ef3ec0efd0..d5fe17cb07e3 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -782,12 +782,9 @@ static inline int nfsd_dosync(struct file *filp, struct dentry *dp,
782 int (*fsync) (struct file *, struct dentry *, int); 782 int (*fsync) (struct file *, struct dentry *, int);
783 int err; 783 int err;
784 784
785 err = filemap_fdatawrite(inode->i_mapping); 785 err = filemap_write_and_wait(inode->i_mapping);
786 if (err == 0 && fop && (fsync = fop->fsync)) 786 if (err == 0 && fop && (fsync = fop->fsync))
787 err = fsync(filp, dp, 0); 787 err = fsync(filp, dp, 0);
788 if (err == 0)
789 err = filemap_fdatawait(inode->i_mapping);
790
791 return err; 788 return err;
792} 789}
793 790