Ceph fixes for 3.12.y
cover Ceph fixes for 3.12.y
Hi,
These patches are for 3.12.y stable. All have been retested and reference the original commit. They can also be pulled from
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git for-stable-3.12.5
if that is preferred.
Thanks!
sage
Li Wang (1):
ceph: allocate non-zero page to fscache in readpage()
Milosz Tanski (1):
ceph: hung on ceph fscache invalidate in some cases
Yan, Zheng (2):
ceph: cleanup aborted requests when re-sending requests.
ceph: wake up 'safe' waiters when unregistering request
fs/ceph/addr.c | 2 +- fs/ceph/cache.c | 3 +++ fs/ceph/mds_client.c | 8 ++++++-- 3 files changed, 10 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.5.1
PATCH 1/4 ceph: hung on ceph fscache invalidate in some cases
From: Milosz Tanski <[email protected]>
In some cases I'm on my ceph client cluster I'm seeing hunk kernel tasks in the invalidate page code path. This is due to the fact that we don't check if the page is marked as cache before calling fscache_wait_on_page_write().
This is the log from the hang
INFO: task XXXXXX:12034 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. ... Call Trace: [<ffffffff81568d09>] schedule+0x29/0x70 [<ffffffffa01d4cbd>] __fscache_wait_on_page_write+0x6d/0xb0 [fscache] [<ffffffff81083520>] ? add_wait_queue+0x60/0x60 [<ffffffffa029a3e9>] ceph_invalidate_fscache_page+0x29/0x50 [ceph] [<ffffffffa027df00>] ceph_invalidatepage+0x70/0x190 [ceph] [<ffffffff8112656f>] ? delete_from_page_cache+0x5f/0x70 [<ffffffff81133cab>] truncate_inode_page+0x8b/0x90 [<ffffffff81133ded>] truncate_inode_pages_range.part.12+0x13d/0x620 [<ffffffff8113431d>] truncate_inode_pages_range+0x4d/0x60 [<ffffffff811343b5>] truncate_inode_pages+0x15/0x20 [<ffffffff8119bbf6>] evict+0x1a6/0x1b0 [<ffffffff8119c3f3>] iput+0x103/0x190 ...
--- fs/ceph/cache.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ceph/cache.c +3 -0
@@ -324,6 +324,9 @@ void ceph_invalidate_fscache_page(struct inode* inode, struct page *page) {struct ceph_inode_info *ci =ceph_inode (inode); +if (!PageFsCache (page)) +return ; +fscache_wait_on_page_write (ci->fscache, page);fscache_uncache_page (ci->fscache, page); }
Signature · 1 line
1.8.5.1
PATCH 2/4 ceph: cleanup aborted requests when re-sending requests.
In reply to Sage WeilFrom: "Yan, Zheng" <[email protected]>
Aborted requests usually get cleared when the reply is received. If MDS crashes, no reply will be received. So we need to cleanup aborted requests when re-sending requests.
--- fs/ceph/mds_client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/ceph/mds_client.c +4 -1
@@ -1875,8 +1875,11 @@ static int __do_request(struct ceph_mds_client *mdsc,int mds =-1 ;int err = -EAGAIN ; -if (req->r_err || req->r_got_result) +if (req->r_err || req->r_got_result) { +if (req->r_aborted) +__unregister_request (mdsc, req); goto out; + }if (req->r_timeout &&time_after_eq (jiffies, req->r_started + req->r_timeout)) {
Signature · 1 line
1.8.5.1
PATCH 3/4 ceph: wake up 'safe' waiters when unregistering request
In reply to Sage WeilFrom: "Yan, Zheng" <[email protected]>
We also need to wake up 'safe' waiters if error occurs or request aborted. Otherwise sync(2)/fsync(2) may hang forever.
--- fs/ceph/mds_client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ceph/mds_client.c +2 -1
@@ -642,6 +642,8 @@ static void __unregister_request(struct ceph_mds_client *mdsc, req->r_unsafe_dir =NULL ; } +complete_all (&req->r_safe_completion); +ceph_mdsc_put_request (req); }
@@ -2189,7 +2191,6 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)if (head->safe) { req->r_got_safe = true;__unregister_request (mdsc, req); -complete_all (&req->r_safe_completion);if (req->r_got_unsafe) {/*
Signature · 1 line
1.8.5.1
PATCH 4/4 ceph: allocate non-zero page to fscache in readpage()
In reply to Sage WeilFrom: Li Wang <[email protected]>
ceph_osdc_readpages() returns number of bytes read, currently, the code only allocate full-zero page into fscache, this patch fixes this.
--- fs/ceph/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/addr.c +1 -1
@@ -216,7 +216,7 @@ static int readpage_nounlock(struct file *filp, struct page *page) }SetPageUptodate (page); -if (err ==0 ) +if (err >=0 )ceph_readpage_to_fscache (inode, page); out:
Signature · 1 line
1.8.5.1
Quoted 8 lines · Sage Weil
Hi,
These patches are for 3.12.y stable. All have been retested and reference the original commit. They can also be pulled from
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.gitfor-stable-3.12.5if that is preferred.
Now applied, and I also added patches 2 and 3 to the 3.10 and 3.4-stable trees as well. If that was incorrect, please let me know.
thanks,
greg k-h
Quoted 6 lines · Greg KH
Quoted 5 lines · Sage Weil
Hi,
These patches are for 3.12.y stable. All have been retested and reference the original commit. They can also be pulled from
Quoted 6 lines
Quoted 3 lines
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.gitfor-stable-3.12.5if that is preferred.
Now applied, and I also added patches 2 and 3 to the 3.10 and 3.4-stable trees as well. If that was incorrect, please let me know.
I've also queued up those two for 3.2.
Ben.
Signature · 2 lines
Ben Hutchings If at first you don't succeed, you're doing about average.