* [PATCH 1/2] ceph fscache: Introduce a routine for uncaching single no data page from fscache
2013-12-19 14:03 [PATCH 0/2] ceph fscache: uncaching single no data page when error Li Wang
@ 2013-12-19 14:03 ` Li Wang
2013-12-19 14:03 ` [PATCH 2/2] ceph fscache: Uncaching no data page from fscache in readpage() Li Wang
2013-12-20 16:03 ` [PATCH 0/2] ceph fscache: uncaching single no data page when error Milosz Tanski
2 siblings, 0 replies; 4+ messages in thread
From: Li Wang @ 2013-12-19 14:03 UTC (permalink / raw)
To: ceph-devel; +Cc: Sage Weil, Milosz Tanski, linux-fsdevel, linux-kernel, Li Wang
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
---
fs/ceph/cache.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/fs/ceph/cache.h b/fs/ceph/cache.h
index ba94940..da95f61 100644
--- a/fs/ceph/cache.h
+++ b/fs/ceph/cache.h
@@ -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)
{
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ceph fscache: Uncaching no data page from fscache in readpage()
2013-12-19 14:03 [PATCH 0/2] ceph fscache: uncaching single no data page when error Li Wang
2013-12-19 14:03 ` [PATCH 1/2] ceph fscache: Introduce a routine for uncaching single no data page from fscache Li Wang
@ 2013-12-19 14:03 ` Li Wang
2013-12-20 16:03 ` [PATCH 0/2] ceph fscache: uncaching single no data page when error Milosz Tanski
2 siblings, 0 replies; 4+ messages in thread
From: Li Wang @ 2013-12-19 14:03 UTC (permalink / raw)
To: ceph-devel; +Cc: Sage Weil, Milosz Tanski, linux-fsdevel, linux-kernel, 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.
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
---
fs/ceph/addr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index ec3ba43..0cc9749 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -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) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] ceph fscache: uncaching single no data page when error
2013-12-19 14:03 [PATCH 0/2] ceph fscache: uncaching single no data page when error Li Wang
2013-12-19 14:03 ` [PATCH 1/2] ceph fscache: Introduce a routine for uncaching single no data page from fscache Li Wang
2013-12-19 14:03 ` [PATCH 2/2] ceph fscache: Uncaching no data page from fscache in readpage() Li Wang
@ 2013-12-20 16:03 ` Milosz Tanski
2 siblings, 0 replies; 4+ messages in thread
From: Milosz Tanski @ 2013-12-20 16:03 UTC (permalink / raw)
To: Li Wang; +Cc: ceph-devel, Sage Weil, linux-fsdevel@vger.kernel.org,
linux-kernel
This looks legit to me.
- M
P.S: Sorry for the first HTML email, I blame gmail.
On Thu, Dec 19, 2013 at 9:03 AM, Li Wang <liwang@ubuntukylin.com> wrote:
> 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
>
--
Milosz Tanski
CTO
10 East 53rd Street, 37th floor
New York, NY 10022
p: 646-253-9055
e: milosz@adfin.com
^ permalink raw reply [flat|nested] 4+ messages in thread