Commit a5277fe8 authored by Trond Myklebust's avatar Trond Myklebust

Subject: [PATCH] NFS: Direct reads and writes need to flush dirty cache pages

 Other parts of the NFS client invoke nfs_wb_all() when they want to flush dirty
 cache pages.  The direct path needs to do that, too.
Signed-off-by: default avatarChuck Lever <cel@netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@fys.uio.no>
parent bfcdbd79
...@@ -678,6 +678,8 @@ nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t ...@@ -678,6 +678,8 @@ nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t
if (mapping->nrpages) { if (mapping->nrpages) {
retval = filemap_fdatawrite(mapping); retval = filemap_fdatawrite(mapping);
if (retval == 0)
retval = nfs_wb_all(inode);
if (retval == 0) if (retval == 0)
retval = filemap_fdatawait(mapping); retval = filemap_fdatawait(mapping);
if (retval) if (retval)
...@@ -767,6 +769,8 @@ nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count, ...@@ -767,6 +769,8 @@ nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count,
if (mapping->nrpages) { if (mapping->nrpages) {
retval = filemap_fdatawrite(mapping); retval = filemap_fdatawrite(mapping);
if (retval == 0)
retval = nfs_wb_all(inode);
if (retval == 0) if (retval == 0)
retval = filemap_fdatawait(mapping); retval = filemap_fdatawait(mapping);
if (retval) if (retval)
......
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