diff mbox

CIFS: Use invalidate_inode_pages2 instead of invalidate_remote_inode

Message ID 1298387346-9228-1-git-send-email-piastry@etersoft.ru (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Shilovsky Feb. 22, 2011, 3:09 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 8852470..1da1f26 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1691,12 +1691,15 @@  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);
 }