aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/messenger.c
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-06-27 12:24:08 -0700
committerSage Weil <sage@inktank.com>2012-07-05 21:14:35 -0700
commitb7a9e5dd40f17a48a72f249b8bbc989b63bae5fd (patch)
treef4951e53776e2ec45f9b539b786be67c8a7f42a2 /net/ceph/messenger.c
parent261030215d970c62f799e6e508e3c68fc7ec2aa9 (diff)
downloadkernel_goldelico_gta04-b7a9e5dd40f17a48a72f249b8bbc989b63bae5fd.zip
kernel_goldelico_gta04-b7a9e5dd40f17a48a72f249b8bbc989b63bae5fd.tar.gz
kernel_goldelico_gta04-b7a9e5dd40f17a48a72f249b8bbc989b63bae5fd.tar.bz2
libceph: set peer name on con_open, not init
The peer name may change on each open attempt, even when the connection is reused. Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r--net/ceph/messenger.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index dcc50e4..ae082d9 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -523,12 +523,17 @@ EXPORT_SYMBOL(ceph_con_close);
/*
* Reopen a closed connection, with a new peer address.
*/
-void ceph_con_open(struct ceph_connection *con, struct ceph_entity_addr *addr)
+void ceph_con_open(struct ceph_connection *con,
+ __u8 entity_type, __u64 entity_num,
+ struct ceph_entity_addr *addr)
{
dout("con_open %p %s\n", con, ceph_pr_addr(&addr->in_addr));
set_bit(OPENING, &con->state);
WARN_ON(!test_and_clear_bit(CLOSED, &con->state));
+ con->peer_name.type = (__u8) entity_type;
+ con->peer_name.num = cpu_to_le64(entity_num);
+
memcpy(&con->peer_addr, addr, sizeof(*addr));
con->delay = 0; /* reset backoff memory */
queue_con(con);
@@ -548,7 +553,7 @@ bool ceph_con_opened(struct ceph_connection *con)
*/
void ceph_con_init(struct ceph_connection *con, void *private,
const struct ceph_connection_operations *ops,
- struct ceph_messenger *msgr, __u8 entity_type, __u64 entity_num)
+ struct ceph_messenger *msgr)
{
dout("con_init %p\n", con);
memset(con, 0, sizeof(*con));
@@ -558,9 +563,6 @@ void ceph_con_init(struct ceph_connection *con, void *private,
con_sock_state_init(con);
- con->peer_name.type = (__u8) entity_type;
- con->peer_name.num = cpu_to_le64(entity_num);
-
mutex_init(&con->mutex);
INIT_LIST_HEAD(&con->out_queue);
INIT_LIST_HEAD(&con->out_sent);