Merge pull request #25437 from Aran85/fix-objecter-reset

objecter: avoid race when reset down osd's session

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Kefu Chai 2019-01-01 00:56:52 +08:00 committed by GitHub
commit 46073b4de0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4373,7 +4373,10 @@ bool Objecter::ms_handle_reset(Connection *con)
if (session) {
ldout(cct, 1) << "ms_handle_reset " << con << " session " << session
<< " osd." << session->osd << dendl;
if (!initialized) {
// the session maybe had been closed if new osdmap just handled
// says the osd down
if (!(initialized && osdmap->is_up(session->osd))) {
ldout(cct, 1) << "ms_handle_reset aborted,initialized=" << initialized << dendl;
wl.unlock();
return false;
}