Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320272
b: refs/heads/master
c: 92ce034
h: refs/heads/master
v: v3
  • Loading branch information
Alex Elder authored and Alex Elder committed Jun 6, 2012
1 parent 8a19e76 commit e1437e7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38941f8031bf042dba3ced6394ba3a3b16c244ea
refs/heads/master: 92ce034b5a740046cc643a21ea21eaad589e0043
24 changes: 18 additions & 6 deletions trunk/net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ static void ceph_msg_remove(struct ceph_msg *msg)
{
list_del_init(&msg->list_head);
BUG_ON(msg->con == NULL);
ceph_con_put(msg->con);
msg->con = NULL;

ceph_msg_put(msg);
Expand All @@ -440,6 +441,7 @@ static void reset_connection(struct ceph_connection *con)
con->in_msg->con = NULL;
ceph_msg_put(con->in_msg);
con->in_msg = NULL;
ceph_con_put(con->in_msg->con);
}

con->connect_seq = 0;
Expand Down Expand Up @@ -1914,6 +1916,7 @@ static void process_message(struct ceph_connection *con)
con->in_msg->con = NULL;
msg = con->in_msg;
con->in_msg = NULL;
ceph_con_put(con);

/* if first message, set peer_name */
if (con->peer_name.type == 0)
Expand Down Expand Up @@ -2275,6 +2278,7 @@ static void ceph_fault(struct ceph_connection *con)
con->in_msg->con = NULL;
ceph_msg_put(con->in_msg);
con->in_msg = NULL;
ceph_con_put(con);
}

/* Requeue anything that hasn't been acked */
Expand Down Expand Up @@ -2391,8 +2395,11 @@ void ceph_con_send(struct ceph_connection *con, struct ceph_msg *msg)

/* queue */
mutex_lock(&con->mutex);

BUG_ON(msg->con != NULL);
msg->con = con;
msg->con = ceph_con_get(con);
BUG_ON(msg->con == NULL);

BUG_ON(!list_empty(&msg->list_head));
list_add_tail(&msg->list_head, &con->out_queue);
dout("----- %p to %s%lld %d=%s len %d+%d+%d -----\n", msg,
Expand Down Expand Up @@ -2421,10 +2428,11 @@ void ceph_con_revoke(struct ceph_connection *con, struct ceph_msg *msg)
dout("%s %p msg %p - was on queue\n", __func__, con, msg);
list_del_init(&msg->list_head);
BUG_ON(msg->con == NULL);
ceph_con_put(msg->con);
msg->con = NULL;
msg->hdr.seq = 0;

ceph_msg_put(msg);
msg->hdr.seq = 0;
}
if (con->out_msg == msg) {
dout("%s %p msg %p - was sending\n", __func__, con, msg);
Expand All @@ -2433,8 +2441,9 @@ void ceph_con_revoke(struct ceph_connection *con, struct ceph_msg *msg)
con->out_skip = con->out_kvec_bytes;
con->out_kvec_is_msg = false;
}
ceph_msg_put(msg);
msg->hdr.seq = 0;

ceph_msg_put(msg);
}
mutex_unlock(&con->mutex);
}
Expand Down Expand Up @@ -2618,8 +2627,10 @@ static bool ceph_con_in_msg_alloc(struct ceph_connection *con,
mutex_unlock(&con->mutex);
con->in_msg = con->ops->alloc_msg(con, hdr, &skip);
mutex_lock(&con->mutex);
if (con->in_msg)
con->in_msg->con = con;
if (con->in_msg) {
con->in_msg->con = ceph_con_get(con);
BUG_ON(con->in_msg->con == NULL);
}
if (skip)
con->in_msg = NULL;

Expand All @@ -2633,7 +2644,8 @@ static bool ceph_con_in_msg_alloc(struct ceph_connection *con,
type, front_len);
return false;
}
con->in_msg->con = con;
con->in_msg->con = ceph_con_get(con);
BUG_ON(con->in_msg->con == NULL);
con->in_msg->page_alignment = le16_to_cpu(hdr->data_off);
}
memcpy(&con->in_msg->hdr, &con->in_hdr, sizeof(con->in_hdr));
Expand Down

0 comments on commit e1437e7

Please sign in to comment.