aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-05-25 18:38:06 -0400
committerSage Weil <sage@newdream.net>2010-05-29 12:12:38 -0400
commit09c4d6a7d40dd26c1b35674c582382b7ea551368 (patch)
treeb3afda46b0342ea3e87980b5bb2f6148ce119414 /fs
parent984c76908efd3c6795aa03dff16a8fc3496af99f (diff)
ceph: do not resend mon requests on auth ticket renewal
We only want to send pending mon requests when we successfully authenticate. If we are already authenticated, like when we renew our ticket, there is no need to resend pending requests. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/mon_client.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c
index f6510a476e7e..21c62e9b7d1d 100644
--- a/fs/ceph/mon_client.c
+++ b/fs/ceph/mon_client.c
@@ -704,8 +704,11 @@ static void handle_auth_reply(struct ceph_mon_client *monc,
704 struct ceph_msg *msg) 704 struct ceph_msg *msg)
705{ 705{
706 int ret; 706 int ret;
707 int was_auth = 0;
707 708
708 mutex_lock(&monc->mutex); 709 mutex_lock(&monc->mutex);
710 if (monc->auth->ops)
711 was_auth = monc->auth->ops->is_authenticated(monc->auth);
709 monc->pending_auth = 0; 712 monc->pending_auth = 0;
710 ret = ceph_handle_auth_reply(monc->auth, msg->front.iov_base, 713 ret = ceph_handle_auth_reply(monc->auth, msg->front.iov_base,
711 msg->front.iov_len, 714 msg->front.iov_len,
@@ -716,7 +719,7 @@ static void handle_auth_reply(struct ceph_mon_client *monc,
716 wake_up(&monc->client->auth_wq); 719 wake_up(&monc->client->auth_wq);
717 } else if (ret > 0) { 720 } else if (ret > 0) {
718 __send_prepared_auth_request(monc, ret); 721 __send_prepared_auth_request(monc, ret);
719 } else if (monc->auth->ops->is_authenticated(monc->auth)) { 722 } else if (!was_auth && monc->auth->ops->is_authenticated(monc->auth)) {
720 dout("authenticated, starting session\n"); 723 dout("authenticated, starting session\n");
721 724
722 monc->client->msgr->inst.name.type = CEPH_ENTITY_TYPE_CLIENT; 725 monc->client->msgr->inst.name.type = CEPH_ENTITY_TYPE_CLIENT;