diff options
author | David Howells <dhowells@redhat.com> | 2013-09-04 13:10:39 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-09-18 11:17:03 -0400 |
commit | 54afa99057ee2ffd3df0f5e891298bbbb65ea63c (patch) | |
tree | bbe235d0310023e4c4eace892b1de10faee13c3f /fs/cifs/fscache.c | |
parent | 62d228b8c676232eca579f91cc0782b060a59097 (diff) |
CIFS: FS-Cache: Uncache unread pages in cifs_readpages() before freeing them
In cifs_readpages(), we may decide we don't want to read a page after all -
but the page may already have passed through fscache_read_or_alloc_pages() and
thus have marks and reservations set. Thus we have to call
fscache_readpages_cancel() or fscache_uncache_page() on the pages we're
returning to clear the marks.
NFS, AFS and 9P should be unaffected by this as they call read_cache_pages()
which does the cleanup for you.
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/fscache.c')
-rw-r--r-- | fs/cifs/fscache.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c index 2f4bc5a58054..b3258f35e88a 100644 --- a/fs/cifs/fscache.c +++ b/fs/cifs/fscache.c | |||
@@ -223,6 +223,13 @@ void __cifs_readpage_to_fscache(struct inode *inode, struct page *page) | |||
223 | fscache_uncache_page(CIFS_I(inode)->fscache, page); | 223 | fscache_uncache_page(CIFS_I(inode)->fscache, page); |
224 | } | 224 | } |
225 | 225 | ||
226 | void __cifs_fscache_readpages_cancel(struct inode *inode, struct list_head *pages) | ||
227 | { | ||
228 | cifs_dbg(FYI, "%s: (fsc: %p, i: %p)\n", | ||
229 | __func__, CIFS_I(inode)->fscache, inode); | ||
230 | fscache_readpages_cancel(CIFS_I(inode)->fscache, pages); | ||
231 | } | ||
232 | |||
226 | void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode) | 233 | void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode) |
227 | { | 234 | { |
228 | struct cifsInodeInfo *cifsi = CIFS_I(inode); | 235 | struct cifsInodeInfo *cifsi = CIFS_I(inode); |