diff options
author | Yan, Zheng <zyan@redhat.com> | 2016-05-17 11:58:02 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-06-01 10:30:12 +0200 |
commit | 368e35857dfab264f512d040c4486c9b13297988 (patch) | |
tree | 25c0caf527c360b6f70a1c01f4e5f25da84c3501 /fs | |
parent | 480ce08a70e4179f34808a3bdbfe6627f624cf54 (diff) | |
download | linux-368e35857dfab264f512d040c4486c9b13297988.tar.gz linux-368e35857dfab264f512d040c4486c9b13297988.tar.bz2 linux-368e35857dfab264f512d040c4486c9b13297988.zip |
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')
-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) 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; |