Commit 7211a4e8 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by J. Bruce Fields

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: default avatarChristoph Hellwig <hch@lst.de>
Cc: stable@kernel.org
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent f69ac2f5
...@@ -782,12 +782,9 @@ static inline int nfsd_dosync(struct file *filp, struct dentry *dp, ...@@ -782,12 +782,9 @@ static inline int nfsd_dosync(struct file *filp, struct dentry *dp,
int (*fsync) (struct file *, struct dentry *, int); int (*fsync) (struct file *, struct dentry *, int);
int err; int err;
err = filemap_fdatawrite(inode->i_mapping); err = filemap_write_and_wait(inode->i_mapping);
if (err == 0 && fop && (fsync = fop->fsync)) if (err == 0 && fop && (fsync = fop->fsync))
err = fsync(filp, dp, 0); err = fsync(filp, dp, 0);
if (err == 0)
err = filemap_fdatawait(inode->i_mapping);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment