aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/messenger.c22
-rw-r--r--net/ceph/osd_client.c9
2 files changed, 20 insertions, 11 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index d636903ad4b2..3857f815c035 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2456,17 +2456,27 @@ void ceph_msg_revoke(struct ceph_msg *msg)
2456/* 2456/*
2457 * Revoke a message that we may be reading data into 2457 * Revoke a message that we may be reading data into
2458 */ 2458 */
2459void ceph_con_revoke_message(struct ceph_connection *con, struct ceph_msg *msg) 2459void ceph_msg_revoke_incoming(struct ceph_msg *msg)
2460{ 2460{
2461 struct ceph_connection *con;
2462
2463 BUG_ON(msg == NULL);
2464 if (!msg->con) {
2465 dout("%s msg %p null con\n", __func__, msg);
2466
2467 return; /* Message not in our possession */
2468 }
2469
2470 con = msg->con;
2461 mutex_lock(&con->mutex); 2471 mutex_lock(&con->mutex);
2462 if (con->in_msg && con->in_msg == msg) { 2472 if (con->in_msg == msg) {
2463 unsigned front_len = le32_to_cpu(con->in_hdr.front_len); 2473 unsigned front_len = le32_to_cpu(con->in_hdr.front_len);
2464 unsigned middle_len = le32_to_cpu(con->in_hdr.middle_len); 2474 unsigned middle_len = le32_to_cpu(con->in_hdr.middle_len);
2465 unsigned data_len = le32_to_cpu(con->in_hdr.data_len); 2475 unsigned data_len = le32_to_cpu(con->in_hdr.data_len);
2466 2476
2467 /* skip rest of message */ 2477 /* skip rest of message */
2468 dout("con_revoke_pages %p msg %p revoked\n", con, msg); 2478 dout("%s %p msg %p revoked\n", __func__, con, msg);
2469 con->in_base_pos = con->in_base_pos - 2479 con->in_base_pos = con->in_base_pos -
2470 sizeof(struct ceph_msg_header) - 2480 sizeof(struct ceph_msg_header) -
2471 front_len - 2481 front_len -
2472 middle_len - 2482 middle_len -
@@ -2477,8 +2487,8 @@ void ceph_con_revoke_message(struct ceph_connection *con, struct ceph_msg *msg)
2477 con->in_tag = CEPH_MSGR_TAG_READY; 2487 con->in_tag = CEPH_MSGR_TAG_READY;
2478 con->in_seq++; 2488 con->in_seq++;
2479 } else { 2489 } else {
2480 dout("con_revoke_pages %p msg %p pages %p no-op\n", 2490 dout("%s %p in_msg %p msg %p no-op\n",
2481 con, con->in_msg, msg); 2491 __func__, con, con->in_msg, msg);
2482 } 2492 }
2483 mutex_unlock(&con->mutex); 2493 mutex_unlock(&con->mutex);
2484} 2494}
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index ad78705a4aff..c178c770acb4 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -140,10 +140,9 @@ void ceph_osdc_release_request(struct kref *kref)
140 if (req->r_request) 140 if (req->r_request)
141 ceph_msg_put(req->r_request); 141 ceph_msg_put(req->r_request);
142 if (req->r_con_filling_msg) { 142 if (req->r_con_filling_msg) {
143 dout("release_request revoking pages %p from con %p\n", 143 dout("%s revoking pages %p from con %p\n", __func__,
144 req->r_pages, req->r_con_filling_msg); 144 req->r_pages, req->r_con_filling_msg);
145 ceph_con_revoke_message(req->r_con_filling_msg, 145 ceph_msg_revoke_incoming(req->r_reply);
146 req->r_reply);
147 req->r_con_filling_msg->ops->put(req->r_con_filling_msg); 146 req->r_con_filling_msg->ops->put(req->r_con_filling_msg);
148 } 147 }
149 if (req->r_reply) 148 if (req->r_reply)
@@ -2022,9 +2021,9 @@ static struct ceph_msg *get_reply(struct ceph_connection *con,
2022 } 2021 }
2023 2022
2024 if (req->r_con_filling_msg) { 2023 if (req->r_con_filling_msg) {
2025 dout("get_reply revoking msg %p from old con %p\n", 2024 dout("%s revoking msg %p from old con %p\n", __func__,
2026 req->r_reply, req->r_con_filling_msg); 2025 req->r_reply, req->r_con_filling_msg);
2027 ceph_con_revoke_message(req->r_con_filling_msg, req->r_reply); 2026 ceph_msg_revoke_incoming(req->r_reply);
2028 req->r_con_filling_msg->ops->put(req->r_con_filling_msg); 2027 req->r_con_filling_msg->ops->put(req->r_con_filling_msg);
2029 req->r_con_filling_msg = NULL; 2028 req->r_con_filling_msg = NULL;
2030 } 2029 }