ceph fscache: Uncaching no data page from fscache in readpage()
authorLi Wang <liwang@ubuntukylin.com>
Thu, 19 Dec 2013 14:03:49 +0000 (06:03 -0800)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 31 Dec 2013 18:32:03 +0000 (20:32 +0200)
Currently, if one new page allocated into fscache in readpage(), however,
with no data read into due to error encountered during reading from OSDs,
the slot in fscache is not uncached. This patch fixes this.

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reviewed-by: Milosz Tanski <milosz@adfin.com>
fs/ceph/addr.c

index ebda329..791a9a2 100644 (file)
@@ -209,6 +209,7 @@ static int readpage_nounlock(struct file *filp, struct page *page)
                err = 0;
        if (err < 0) {
                SetPageError(page);
+               ceph_fscache_readpage_cancel(inode, page);
                goto out;
        } else {
                if (err < PAGE_CACHE_SIZE) {