Merge PR #25823 into master

* refs/pull/25823/head:
	msg/async/Protocol*: fix mark_down vs accept race

Reviewed-by: Ricardo Dias <rdias@suse.com>
Reviewed-by: Gregory Farnum <gfarnum@redhat.com>
Reviewed-by: Greg Farnum <gfarnum@redhat.com>
This commit is contained in:
Sage Weil 2019-01-08 13:05:11 -06:00
commit 2483b774f2
2 changed files with 14 additions and 0 deletions

View File

@ -1933,6 +1933,13 @@ CtPtr ProtocolV1::handle_connect_message_2() {
need_challenge ? &authorizer_challenge : nullptr) ||
!authorizer_valid) {
connection->lock.lock();
if (state != ACCEPTING_WAIT_CONNECT_MSG_AUTH) {
ldout(cct, 1) << __func__
<< " state changed while accept, it must be mark_down"
<< dendl;
ceph_assert(state == CLOSED);
return _fault();
}
if (need_challenge && !had_challenge && authorizer_challenge) {
ldout(cct, 10) << __func__ << ": challenging authorizer" << dendl;

View File

@ -1980,6 +1980,13 @@ CtPtr ProtocolV2::handle_connect_message_2() {
need_challenge ? &authorizer_challenge : nullptr) ||
!authorizer_valid) {
connection->lock.lock();
if (state != ACCEPTING_WAIT_CONNECT_MSG_AUTH) {
ldout(cct, 1) << __func__
<< " state changed while accept, it must be mark_down"
<< dendl;
ceph_assert(state == CLOSED);
return _fault();
}
if (need_challenge && !had_challenge && authorizer_challenge) {
ldout(cct, 10) << __func__ << ": challenging authorizer" << dendl;