Skip to contentSkip to conversation

Ceph fixes for 3.12.y

PATCH In review Sage Weil 3 participants 7 messages Dec 31, 2013 – Feb 9, 2014 Ceph client

lore
Share & tools
lore

Sage Weil

author
#0 lore raw

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
author
#1 lore raw

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
 ...
(cherry picked from commit ffc79664d15841025d90afdd902c4112ffe168d6)
---
 fs/ceph/cache.c | 3 +++
 1 file changed, 3 insertions(+)
fs/ceph/cache.c +3 -0
index 6bfe65e..360b622 100644
@@ -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
author
#2 lore raw

PATCH 2/4 ceph: cleanup aborted requests when re-sending requests.

In reply to Sage Weil

From: "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.

(cherry picked from commit eb1b8af33c2e42a9a57fc0a7588f4a7b255d2e79)
---
 fs/ceph/mds_client.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
fs/ceph/mds_client.c +4 -1
index b7bda5d..91214b2 100644
@@ -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
author
#3 lore raw

PATCH 3/4 ceph: wake up 'safe' waiters when unregistering request

In reply to Sage Weil

From: "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.

(cherry picked from commit fc55d2c9448b34218ca58733a6f51fbede09575b)
---
 fs/ceph/mds_client.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ceph/mds_client.c +2 -1
index 91214b2..7889015 100644
@@ -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
author
#4 lore raw

PATCH 4/4 ceph: allocate non-zero page to fscache in readpage()

In reply to Sage Weil

From: 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.

(cherry picked from commit ff638b7df5a9264024a6448bdfde2b2bf5d1994a)
---
 fs/ceph/addr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/addr.c +1 -1
index 6df8bd4..1e561c0 100644
@@ -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
#5 lore raw
In reply to Sage Weil
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.git for-stable-3.12.5

if 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

#6 lore raw
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.git for-stable-3.12.5

if 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.