Skip to contentSkip to conversation

ceph: Add clean up if invalid osd reply received

PATCH In review Li Wang 2 participants 4 messages Nov 27, 2013 – Dec 5, 2013

Subsystems (3)
lore
Share & tools
lore

Li Wang

author
#0 lore raw

cover ceph: Add clean up if invalid osd reply received

Li Wang (2):
ceph: Clean up if error occurred in finish_read()
ceph: Add necessary clean up if invalid reply received in
handle_reply()

 fs/ceph/addr.c        |    3 +++
 net/ceph/osd_client.c |    7 +++++++
 2 files changed, 10 insertions(+)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/2 ceph: Clean up if error occurred in finish_read()

Clean up if error occurred rather than going through normal process

---
 fs/ceph/addr.c |    3 +++
 1 file changed, 3 insertions(+)
fs/ceph/addr.c +3 -0
index 1e561c0..97845b4 100644
@@ -252,6 +252,8 @@ static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg)
 	for (i = 0; i < num_pages; i++) {
 		struct page *page = osd_data->pages[i];
 
+		if (rc < 0)
+			goto unlock;
 		if (bytes < (int)PAGE_CACHE_SIZE) {
 			/* zero (remainder of) page */
 			int s = bytes < 0 ? 0 : bytes;
@@ -262,6 +264,7 @@ static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg)
 		flush_dcache_page(page);
 		SetPageUptodate(page);
 		ceph_readpage_to_fscache(inode, page);
+unlock:
 		unlock_page(page);
 		page_cache_release(page);
 		bytes -= PAGE_CACHE_SIZE;
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 2/2 ceph: Add necessary clean up if invalid reply received in handle_reply()

In reply to Li Wang

Wake up possible waiters, invoke the call back if any, unregister the request

---
 net/ceph/osd_client.c |    7 +++++++
 1 file changed, 7 insertions(+)
net/ceph/osd_client.c +7 -0
index 2b4b32a..a17eaae 100644
@@ -1581,6 +1581,13 @@ done:
 	return;
 
 bad_put:
+	req->r_result = -EIO;
+	__unregister_request(osdc, req);
+	if (req->r_callback)
+		req->r_callback(req, msg);
+	else
+		complete_all(&req->r_completion);
+	complete_request(req);
 	ceph_osdc_put_request(req);
 bad_mutex:
 	mutex_unlock(&osdc->request_mutex);
Signature · 1 line
1.7.9.5
#3 lore raw
In reply to Li Wang

APplied these both to teh testing branch. Thanks!

Quoted 21 lines · Li Wang

Li Wang (2):
ceph: Clean up if error occurred in finish_read()
ceph: Add necessary clean up if invalid reply received in
handle_reply()

 fs/ceph/addr.c        |    3 +++
 net/ceph/osd_client.c |    7 +++++++
 2 files changed, 10 insertions(+)
Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html