diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index eb955b525e55..7ddddf2e2504 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -3254,6 +3254,9 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, | |||
3254 | /* | 3254 | /* |
3255 | * Reads as many pages as possible from fscache. Returns -ENOBUFS | 3255 | * Reads as many pages as possible from fscache. Returns -ENOBUFS |
3256 | * immediately if the cookie is negative | 3256 | * immediately if the cookie is negative |
3257 | * | ||
3258 | * After this point, every page in the list might have PG_fscache set, | ||
3259 | * so we will need to clean that up off of every page we don't use. | ||
3257 | */ | 3260 | */ |
3258 | rc = cifs_readpages_from_fscache(mapping->host, mapping, page_list, | 3261 | rc = cifs_readpages_from_fscache(mapping->host, mapping, page_list, |
3259 | &num_pages); | 3262 | &num_pages); |
@@ -3376,6 +3379,11 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, | |||
3376 | kref_put(&rdata->refcount, cifs_readdata_release); | 3379 | kref_put(&rdata->refcount, cifs_readdata_release); |
3377 | } | 3380 | } |
3378 | 3381 | ||
3382 | /* Any pages that have been shown to fscache but didn't get added to | ||
3383 | * the pagecache must be uncached before they get returned to the | ||
3384 | * allocator. | ||
3385 | */ | ||
3386 | cifs_fscache_readpages_cancel(mapping->host, page_list); | ||
3379 | return rc; | 3387 | return rc; |
3380 | } | 3388 | } |
3381 | 3389 | ||