From: Milosz Tanski <milosz@adfin.com>
To: ceph-devel@vger.kernel.org
Cc: sage@inktank.com, zheng.z.yan@intel.com, dhowells@redhat.com,
linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 5/5] ceph: clean PgPrivate2 on returning from readpages
Date: Wed, 21 Aug 2013 17:30:27 -0400 [thread overview]
Message-ID: <b58df1940ff867aa12ada71d2a21eefb2d84494b.1375999914.git.milosz@adfin.com> (raw)
In-Reply-To: <cover.1375999914.git.milosz@adfin.com>
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>
---
fs/ceph/addr.c | 2 ++
fs/ceph/cache.h | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 632bb48..e8ea383 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -413,6 +413,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 23f2666..a0642ee 100644
--- a/fs/ceph/cache.h
+++ b/fs/ceph/cache.h
@@ -81,6 +81,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_readpage_from_fscache(struct inode* inode,
--
1.8.1.2
next prev parent reply other threads:[~2013-08-21 21:30 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-21 21:26 [PATCHv4 0/5] ceph: persistent caching with fscache Milosz Tanski
2013-08-21 21:29 ` [PATCH 1/5] new cachefiles interface to check cache consistency Hongyi Jia
2013-08-21 21:29 ` [PATCH 2/5] new fscache " Hongyi Jia
2013-08-21 21:29 ` [PATCH 3/5] ceph: use fscache as a local presisent cache Milosz Tanski
2013-08-27 1:05 ` Sage Weil
2013-08-21 21:30 ` [PATCH 4/5] fscache: netfs function for cleanup post readpages Milosz Tanski
2013-09-03 17:24 ` Milosz Tanski
2013-08-21 21:30 ` Milosz Tanski [this message]
[not found] ` <cover.1375999914.git.milosz-B5zB6C1i6pkAvxtiuMwx3w@public.gmane.org>
2013-08-22 5:05 ` [PATCHv4 0/5] ceph: persistent caching with fscache Sage Weil
[not found] ` <alpine.DEB.2.00.1308212203320.1479-vIokxiIdD2AQNTJnQDzGJqxOck334EZe@public.gmane.org>
2013-08-22 12:58 ` Milosz Tanski
2013-09-04 15:49 ` David Howells
2013-09-04 15:54 ` Sage Weil
[not found] ` <alpine.DEB.2.00.1309040851080.27503-vIokxiIdD2AQNTJnQDzGJqxOck334EZe@public.gmane.org>
2013-09-04 16:25 ` Sage Weil
2013-09-05 12:34 ` David Howells
2013-09-04 16:24 ` [PATCH 2/5] new fscache interface to check cache consistency David Howells
2013-09-04 16:48 ` Milosz Tanski
2013-09-04 17:26 ` David Howells
2013-09-04 18:04 ` Milosz Tanski
2013-09-04 18:13 ` David Howells
2013-09-04 19:41 ` Milosz Tanski
2013-09-04 22:02 ` Milosz Tanski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b58df1940ff867aa12ada71d2a21eefb2d84494b.1375999914.git.milosz@adfin.com \
--to=milosz@adfin.com \
--cc=ceph-devel@vger.kernel.org \
--cc=dhowells@redhat.com \
--cc=linux-cachefs@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sage@inktank.com \
--cc=zheng.z.yan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).