If we mark_down the connection while we have the lock dropped the state
maybe CLOSED when we retake it. Bail out if that happens instead of
continuing to process the connection and eventually running into an
assertion on can_write.
Fixes: http://tracker.ceph.com/issues/36497
Signed-off-by: Sage Weil <sage@redhat.com>
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;
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;