diff options
Diffstat (limited to 'net/ceph/messenger.c')
| -rw-r--r-- | net/ceph/messenger.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index d5718284db57..7e71b0df1fbc 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
| @@ -2058,6 +2058,8 @@ static int process_connect(struct ceph_connection *con) | |||
| 2058 | dout("process_connect on %p tag %d\n", con, (int)con->in_tag); | 2058 | dout("process_connect on %p tag %d\n", con, (int)con->in_tag); |
| 2059 | 2059 | ||
| 2060 | if (con->auth) { | 2060 | if (con->auth) { |
| 2061 | int len = le32_to_cpu(con->in_reply.authorizer_len); | ||
| 2062 | |||
| 2061 | /* | 2063 | /* |
| 2062 | * Any connection that defines ->get_authorizer() | 2064 | * Any connection that defines ->get_authorizer() |
| 2063 | * should also define ->add_authorizer_challenge() and | 2065 | * should also define ->add_authorizer_challenge() and |
| @@ -2067,8 +2069,7 @@ static int process_connect(struct ceph_connection *con) | |||
| 2067 | */ | 2069 | */ |
| 2068 | if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) { | 2070 | if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) { |
| 2069 | ret = con->ops->add_authorizer_challenge( | 2071 | ret = con->ops->add_authorizer_challenge( |
| 2070 | con, con->auth->authorizer_reply_buf, | 2072 | con, con->auth->authorizer_reply_buf, len); |
| 2071 | le32_to_cpu(con->in_reply.authorizer_len)); | ||
| 2072 | if (ret < 0) | 2073 | if (ret < 0) |
| 2073 | return ret; | 2074 | return ret; |
| 2074 | 2075 | ||
| @@ -2078,10 +2079,12 @@ static int process_connect(struct ceph_connection *con) | |||
| 2078 | return 0; | 2079 | return 0; |
| 2079 | } | 2080 | } |
| 2080 | 2081 | ||
| 2081 | ret = con->ops->verify_authorizer_reply(con); | 2082 | if (len) { |
| 2082 | if (ret < 0) { | 2083 | ret = con->ops->verify_authorizer_reply(con); |
| 2083 | con->error_msg = "bad authorize reply"; | 2084 | if (ret < 0) { |
| 2084 | return ret; | 2085 | con->error_msg = "bad authorize reply"; |
| 2086 | return ret; | ||
| 2087 | } | ||
| 2085 | } | 2088 | } |
| 2086 | } | 2089 | } |
| 2087 | 2090 | ||
| @@ -3206,9 +3209,10 @@ void ceph_con_keepalive(struct ceph_connection *con) | |||
| 3206 | dout("con_keepalive %p\n", con); | 3209 | dout("con_keepalive %p\n", con); |
| 3207 | mutex_lock(&con->mutex); | 3210 | mutex_lock(&con->mutex); |
| 3208 | clear_standby(con); | 3211 | clear_standby(con); |
| 3212 | con_flag_set(con, CON_FLAG_KEEPALIVE_PENDING); | ||
| 3209 | mutex_unlock(&con->mutex); | 3213 | mutex_unlock(&con->mutex); |
| 3210 | if (con_flag_test_and_set(con, CON_FLAG_KEEPALIVE_PENDING) == 0 && | 3214 | |
| 3211 | con_flag_test_and_set(con, CON_FLAG_WRITE_PENDING) == 0) | 3215 | if (con_flag_test_and_set(con, CON_FLAG_WRITE_PENDING) == 0) |
| 3212 | queue_con(con); | 3216 | queue_con(con); |
| 3213 | } | 3217 | } |
| 3214 | EXPORT_SYMBOL(ceph_con_keepalive); | 3218 | EXPORT_SYMBOL(ceph_con_keepalive); |
