Skip to contentSkip to conversation

ceph fscache: uncaching single no data page when error

PATCH In review Li Wang 2 participants 4 messages Dec 19, 2013 – Dec 20, 2013

Subsystems (2)
lore
Share & tools
lore

Li Wang

author
#0 lore raw

cover ceph fscache: uncaching single no data page when error

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.

Li Wang (2):
ceph: Introduce a routine for uncaching single no data page from
fscache
ceph: Uncaching no data page from fscache in readpage()

 fs/ceph/addr.c  |    1 +
 fs/ceph/cache.h |   13 +++++++++++++
 2 files changed, 14 insertions(+)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/2 ceph fscache: Introduce a routine for uncaching single no data page from fscache

---
 fs/ceph/cache.h |   13 +++++++++++++
 1 file changed, 13 insertions(+)
fs/ceph/cache.h +13 -0
index ba94940..da95f61 100644
@@ -67,6 +67,14 @@ 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_readpage_cancel(struct inode *inode,
+						struct page *page)
+{
+	struct ceph_inode_info *ci = ceph_inode(inode);
+	if (fscache_cookie_valid(ci->fscache) && PageFsCache(page))
+		__fscache_uncache_page(ci->fscache, page);
+}
+
 static inline void ceph_fscache_readpages_cancel(struct inode *inode,
 						 struct list_head *pages)
 {
@@ -145,6 +153,11 @@ static inline int ceph_release_fscache_page(struct page *page, gfp_t gfp)
 	return 1;
 }
 
+static inline void ceph_fscache_readpage_cancel(struct inode *inode,
+						struct page *page)
+{
+}
+
 static inline void ceph_fscache_readpages_cancel(struct inode *inode,
 						 struct list_head *pages)
 {
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 2/2 ceph fscache: Uncaching no data page from fscache in readpage()

In reply to Li Wang

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.

---
 fs/ceph/addr.c |    1 +
 1 file changed, 1 insertion(+)
fs/ceph/addr.c +1 -0
index ec3ba43..0cc9749 100644
@@ -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) {
Signature · 1 line
1.7.9.5
#3 lore raw
In reply to Li Wang

This looks legit to me.

- M

P.S: Sorry for the first HTML email, I blame gmail.

Quoted 16 lines · Li Wang

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.

Li Wang (2):
ceph: Introduce a routine for uncaching single no data page from
fscache
ceph: Uncaching no data page from fscache in readpage()

 fs/ceph/addr.c  |    1 +
 fs/ceph/cache.h |   13 +++++++++++++
 2 files changed, 14 insertions(+)

--
1.7.9.5

Signature · 7 lines
Milosz Tanski
CTO
10 East 53rd Street, 37th floor
New York, NY 10022

p: 646-253-9055
e: [email protected]