diff mbox

[1/6] CIFS: Make cifsFileInfo_put work with strict cache mode

Message ID AANLkTi=WzPB6o_f0KL2Sxgdv0Ve4jqK22w8qzdSUTfOj@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Shilovsky Nov. 19, 2010, 11:55 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index ff7d299..66d3ba3 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1679,12 +1679,16 @@  cifs_invalidate_mapping(struct inode *inode)

        cifs_i->invalid_mapping = false;

-       /* write back any cached data */
-       if (inode->i_mapping && inode->i_mapping->nrpages != 0) {
-               rc = filemap_write_and_wait(inode->i_mapping);
-               mapping_set_error(inode->i_mapping, rc);
+       if (inode->i_mapping) {
+               /* write back any cached data */
+               if (inode->i_mapping->nrpages != 0) {
+                       rc = filemap_write_and_wait(inode->i_mapping);
+                       mapping_set_error(inode->i_mapping, rc);
+               }
+
+               invalidate_inode_pages2(inode->i_mapping);
        }
-       invalidate_remote_inode(inode);
+
        cifs_fscache_reset_inode_cookie(inode);
 }