msg/async: msgr2: fix mark_down vs accept race

Msgr2 version of PR #25823

Signed-off-by: Ricardo Dias <rdias@suse.com>
This commit is contained in:
Ricardo Dias 2019-01-14 11:47:15 +00:00
parent 3093667b19
commit f4beb0e7c4
No known key found for this signature in database
GPG Key ID: 74390C579BD37B68

View File

@ -2391,6 +2391,14 @@ CtPtr ProtocolV2::handle_cephx_auth(bufferlist &auth_payload) {
connection->lock.lock();
if (state != ACCEPTING) {
ldout(cct, 1) << __func__
<< " state changed while accept, it must be mark_down"
<< dendl;
ceph_assert(state == CLOSED);
return _fault();
}
session_security.reset(
get_auth_session_handler(cct, auth_method, session_key,
connection_secret,
@ -2456,6 +2464,14 @@ CtPtr ProtocolV2::handle_auth_request(char *payload, uint32_t length) {
nullptr);
connection->lock.lock();
if (state != ACCEPTING) {
ldout(cct, 1) << __func__
<< " state changed while accept, it must be mark_down"
<< dendl;
ceph_assert(state == CLOSED);
return _fault();
}
if (!authorizer_valid) {
ldout(cct, 0) << __func__ << " got bad authorizer, auth_reply_len="
<< authorizer_reply.length() << dendl;