CIFS: Fix possible data coherency problem after oplock break to None
authorPavel Shilovsky <piastry@etersoft.ru>
Thu, 6 Dec 2012 17:24:33 +0000 (21:24 +0400)
committerSteve French <smfrench@gmail.com>
Fri, 7 Dec 2012 19:08:07 +0000 (13:08 -0600)
by using cifs_invalidate_mapping rather than invalidate_remote_inode
in cifs_oplock_break - this invalidates all inode pages and resets
fscache cookies.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/file.c

index ebebbb2bc1fb811eb68aeb6c65d08e23e7e76e90..1b322d041f1ef24bcee43b1206fc3630cf40d4b6 100644 (file)
@@ -3554,7 +3554,7 @@ void cifs_oplock_break(struct work_struct *work)
                if (cinode->clientCanCacheRead == 0) {
                        rc = filemap_fdatawait(inode->i_mapping);
                        mapping_set_error(inode->i_mapping, rc);
-                       invalidate_remote_inode(inode);
+                       cifs_invalidate_mapping(inode);
                }
                cFYI(1, "Oplock flush inode %p rc %d", inode, rc);
        }