From: xie xingguo Date: Tue, 15 Jan 2019 05:47:09 +0000 (+0800) Subject: msg/async: fix mark_down vs accept race X-Git-Tag: v12.2.12~71^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4afdfea6b92e5232f4082b0c9a0803f55d977a3;p=ceph.git msg/async: fix mark_down vs accept race Signed-off-by: xie xingguo --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index c54a5b7e1c4f..572ced03e944 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -1542,6 +1542,14 @@ ssize_t AsyncConnection::handle_connect_msg(ceph_msg_connect &connect, bufferlis need_challenge ? &authorizer_challenge : nullptr) || !authorizer_valid) { lock.lock(); + if (state != STATE_ACCEPTING_WAIT_CONNECT_MSG_AUTH) { + ldout(async_msgr->cct, 1) << __func__ + << " state changed while verify_authorizer," + << " it must be mark_down" + << dendl; + ceph_assert(state == STATE_CLOSED); + return -1; + } char tag; if (need_challenge && !had_challenge && authorizer_challenge) { ldout(async_msgr->cct,10) << __func__ << ": challenging authorizer"