mirror of
https://github.com/ceph/ceph
synced 2025-02-22 18:47:18 +00:00
mgr/MgrStandby: prevent use-after-free on just-shut-down Mgr
Fixes: http://tracker.ceph.com/issues/19595 Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
25b8e0f63f
commit
890f482568
@ -258,8 +258,9 @@ bool MgrStandby::ms_dispatch(Message *m)
|
||||
|
||||
default:
|
||||
if (active_mgr) {
|
||||
auto am = active_mgr;
|
||||
lock.Unlock();
|
||||
active_mgr->ms_dispatch(m);
|
||||
am->ms_dispatch(m);
|
||||
lock.Lock();
|
||||
} else {
|
||||
return false;
|
||||
|
@ -53,7 +53,7 @@ protected:
|
||||
Mutex lock;
|
||||
SafeTimer timer;
|
||||
|
||||
std::unique_ptr<Mgr> active_mgr;
|
||||
std::shared_ptr<Mgr> active_mgr;
|
||||
|
||||
std::string state_str();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user