ceph fscache: uncaching single no data page when error
Subsystems (2)
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
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
@@ -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
PATCH 2/2 ceph fscache: Uncaching no data page from fscache in readpage()
In reply to Li WangCurrently, 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
@@ -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
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 inreadpage()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]