diff options
author | Yan, Zheng <zyan@redhat.com> | 2016-05-16 23:58:02 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-06-01 04:30:12 -0400 |
commit | 368e35857dfab264f512d040c4486c9b13297988 (patch) | |
tree | 25c0caf527c360b6f70a1c01f4e5f25da84c3501 | |
parent | 480ce08a70e4179f34808a3bdbfe6627f624cf54 (diff) |
ceph: call __fscache_uncache_page() if readpages fails
If readpages fails, fscache needs to cleanup its internal state.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
-rw-r--r-- | fs/ceph/addr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index eeb71e5de27a..4ff62fc98fb5 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -276,8 +276,10 @@ static void finish_read(struct ceph_osd_request *req) | |||
276 | for (i = 0; i < num_pages; i++) { | 276 | for (i = 0; i < num_pages; i++) { |
277 | struct page *page = osd_data->pages[i]; | 277 | struct page *page = osd_data->pages[i]; |
278 | 278 | ||
279 | if (rc < 0 && rc != -ENOENT) | 279 | if (rc < 0 && rc != -ENOENT) { |
280 | ceph_fscache_readpage_cancel(inode, page); | ||
280 | goto unlock; | 281 | goto unlock; |
282 | } | ||
281 | if (bytes < (int)PAGE_SIZE) { | 283 | if (bytes < (int)PAGE_SIZE) { |
282 | /* zero (remainder of) page */ | 284 | /* zero (remainder of) page */ |
283 | int s = bytes < 0 ? 0 : bytes; | 285 | int s = bytes < 0 ? 0 : bytes; |