diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2011-03-15 18:55:32 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-05-19 10:10:50 -0400 |
commit | 257fb1f15d72f89dad2d72fa467c189f2d7fdd71 (patch) | |
tree | 75069bb2801c4e9642d00b702c0c2e742826de33 /fs | |
parent | fd5707e1b44560d18b47d552c1871ea0bfc46688 (diff) |
CIFS: Use invalidate_inode_pages2 instead of invalidate_remote_inode (try #4)
Use invalidate_inode_pages2 that don't leave pages even if shrink_page_list()
has a temp ref on them. It prevents a data coherency problem when
cifs_invalidate_mapping didn't invalidate pages but the client thinks that a data
from the cache is uptodate according to an oplock level (exclusive or II).
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/inode.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 196ef607802..fbe7d585856 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1691,12 +1691,18 @@ cifs_invalidate_mapping(struct inode *inode) | |||
1691 | 1691 | ||
1692 | cifs_i->invalid_mapping = false; | 1692 | cifs_i->invalid_mapping = false; |
1693 | 1693 | ||
1694 | /* write back any cached data */ | ||
1695 | if (inode->i_mapping && inode->i_mapping->nrpages != 0) { | 1694 | if (inode->i_mapping && inode->i_mapping->nrpages != 0) { |
1695 | /* write back any cached data */ | ||
1696 | rc = filemap_write_and_wait(inode->i_mapping); | 1696 | rc = filemap_write_and_wait(inode->i_mapping); |
1697 | mapping_set_error(inode->i_mapping, rc); | 1697 | mapping_set_error(inode->i_mapping, rc); |
1698 | rc = invalidate_inode_pages2(inode->i_mapping); | ||
1699 | if (rc) { | ||
1700 | cERROR(1, "%s: could not invalidate inode %p", __func__, | ||
1701 | inode); | ||
1702 | cifs_i->invalid_mapping = true; | ||
1703 | } | ||
1698 | } | 1704 | } |
1699 | invalidate_remote_inode(inode); | 1705 | |
1700 | cifs_fscache_reset_inode_cookie(inode); | 1706 | cifs_fscache_reset_inode_cookie(inode); |
1701 | } | 1707 | } |
1702 | 1708 | ||