summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilosz Tanski <milosz@adfin.com>2013-08-21 17:30:27 -0400
committerMilosz Tanski <milosz@adfin.com>2013-09-06 16:50:11 +0000
commit76be778b3a4eae63ee4dcb22ff2045d3a0fe863b (patch)
treeb656adc374f4037b08a628e28ea107b6d27e03ce
parent99ccbd229cf7453206bc858e795ec1f0345ff258 (diff)
ceph: clean PgPrivate2 on returning from readpages
In some cases the ceph readapages code code bails without filling all the pages already marked by fscache. When we return back to readahead code this causes a BUG. Signed-off-by: Milosz Tanski <milosz@adfin.com>
-rw-r--r--fs/ceph/addr.c2
-rw-r--r--fs/ceph/cache.h7
2 files changed, 9 insertions, 0 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 3a21a7cbc21c..1fda9cf04a81 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -398,6 +398,8 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
BUG_ON(rc == 0);
}
out:
+ ceph_fscache_readpages_cancel(inode, page_list);
+
dout("readpages %p file %p ret %d\n", inode, file, rc);
return rc;
}
diff --git a/fs/ceph/cache.h b/fs/ceph/cache.h
index 0ea95cb7f389..fb326fd33251 100644
--- a/fs/ceph/cache.h
+++ b/fs/ceph/cache.h
@@ -58,6 +58,13 @@ static inline int ceph_release_fscache_page(struct page *page, gfp_t gfp)
return fscache_maybe_release_page(ci->fscache, page, gfp);
}
+static inline void ceph_fscache_readpages_cancel(struct inode *inode,
+ struct list_head *pages)
+{
+ struct ceph_inode_info *ci = ceph_inode(inode);
+ return fscache_readpages_cancel(ci->fscache, pages);
+}
+
#else
static inline int ceph_fscache_register(void)