aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/direct.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r--fs/nfs/direct.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 1e873fcab947..bdfabf854a51 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -497,6 +497,7 @@ static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode
497 if (dreq->commit_data != NULL) 497 if (dreq->commit_data != NULL)
498 nfs_commit_free(dreq->commit_data); 498 nfs_commit_free(dreq->commit_data);
499 nfs_direct_free_writedata(dreq); 499 nfs_direct_free_writedata(dreq);
500 nfs_zap_mapping(inode, inode->i_mapping);
500 nfs_direct_complete(dreq); 501 nfs_direct_complete(dreq);
501 } 502 }
502} 503}
@@ -517,6 +518,7 @@ static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode
517{ 518{
518 nfs_end_data_update(inode); 519 nfs_end_data_update(inode);
519 nfs_direct_free_writedata(dreq); 520 nfs_direct_free_writedata(dreq);
521 nfs_zap_mapping(inode, inode->i_mapping);
520 nfs_direct_complete(dreq); 522 nfs_direct_complete(dreq);
521} 523}
522#endif 524#endif
@@ -830,17 +832,6 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
830 832
831 retval = nfs_direct_write(iocb, (unsigned long) buf, count, pos); 833 retval = nfs_direct_write(iocb, (unsigned long) buf, count, pos);
832 834
833 /*
834 * XXX: nfs_end_data_update() already ensures this file's
835 * cached data is subsequently invalidated. Do we really
836 * need to call invalidate_inode_pages2() again here?
837 *
838 * For aio writes, this invalidation will almost certainly
839 * occur before the writes complete. Kind of racey.
840 */
841 if (mapping->nrpages)
842 invalidate_inode_pages2(mapping);
843
844 if (retval > 0) 835 if (retval > 0)
845 iocb->ki_pos = pos + retval; 836 iocb->ki_pos = pos + retval;
846 837