summaryrefslogtreecommitdiffstats
path: root/fs/ceph/addr.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-05-17 11:58:02 +0800
committerIlya Dryomov <idryomov@gmail.com>2016-06-01 10:30:12 +0200
commit368e35857dfab264f512d040c4486c9b13297988 (patch)
tree25c0caf527c360b6f70a1c01f4e5f25da84c3501 /fs/ceph/addr.c
parent480ce08a70e4179f34808a3bdbfe6627f624cf54 (diff)
downloadlinux-368e35857dfab264f512d040c4486c9b13297988.tar.bz2
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>
Diffstat (limited to 'fs/ceph/addr.c')
-rw-r--r--fs/ceph/addr.c4
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)
for (i = 0; i < num_pages; i++) {
struct page *page = osd_data->pages[i];
- if (rc < 0 && rc != -ENOENT)
+ if (rc < 0 && rc != -ENOENT) {
+ ceph_fscache_readpage_cancel(inode, page);
goto unlock;
+ }
if (bytes < (int)PAGE_SIZE) {
/* zero (remainder of) page */
int s = bytes < 0 ? 0 : bytes;