diff options
author | Sage Weil <sage@inktank.com> | 2012-06-27 15:24:08 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-07-06 00:14:35 -0400 |
commit | b7a9e5dd40f17a48a72f249b8bbc989b63bae5fd (patch) | |
tree | f4951e53776e2ec45f9b539b786be67c8a7f42a2 /fs/ceph | |
parent | 261030215d970c62f799e6e508e3c68fc7ec2aa9 (diff) |
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 'fs/ceph')
-rw-r--r-- | fs/ceph/mds_client.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index ecd7f15741c1..5ac6434185ae 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -394,8 +394,7 @@ static struct ceph_mds_session *register_session(struct ceph_mds_client *mdsc, | |||
394 | s->s_seq = 0; | 394 | s->s_seq = 0; |
395 | mutex_init(&s->s_mutex); | 395 | mutex_init(&s->s_mutex); |
396 | 396 | ||
397 | ceph_con_init(&s->s_con, s, &mds_con_ops, &mdsc->fsc->client->msgr, | 397 | ceph_con_init(&s->s_con, s, &mds_con_ops, &mdsc->fsc->client->msgr); |
398 | CEPH_ENTITY_TYPE_MDS, mds); | ||
399 | 398 | ||
400 | spin_lock_init(&s->s_gen_ttl_lock); | 399 | spin_lock_init(&s->s_gen_ttl_lock); |
401 | s->s_cap_gen = 0; | 400 | s->s_cap_gen = 0; |
@@ -437,7 +436,8 @@ static struct ceph_mds_session *register_session(struct ceph_mds_client *mdsc, | |||
437 | mdsc->sessions[mds] = s; | 436 | mdsc->sessions[mds] = s; |
438 | atomic_inc(&s->s_ref); /* one ref to sessions[], one to caller */ | 437 | atomic_inc(&s->s_ref); /* one ref to sessions[], one to caller */ |
439 | 438 | ||
440 | ceph_con_open(&s->s_con, ceph_mdsmap_get_addr(mdsc->mdsmap, mds)); | 439 | ceph_con_open(&s->s_con, CEPH_ENTITY_TYPE_MDS, mds, |
440 | ceph_mdsmap_get_addr(mdsc->mdsmap, mds)); | ||
441 | 441 | ||
442 | return s; | 442 | return s; |
443 | 443 | ||
@@ -2529,6 +2529,7 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, | |||
2529 | session->s_seq = 0; | 2529 | session->s_seq = 0; |
2530 | 2530 | ||
2531 | ceph_con_open(&session->s_con, | 2531 | ceph_con_open(&session->s_con, |
2532 | CEPH_ENTITY_TYPE_MDS, mds, | ||
2532 | ceph_mdsmap_get_addr(mdsc->mdsmap, mds)); | 2533 | ceph_mdsmap_get_addr(mdsc->mdsmap, mds)); |
2533 | 2534 | ||
2534 | /* replay unsafe requests */ | 2535 | /* replay unsafe requests */ |