]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
msgr/async: fix unsafe access in unregister_conn() 43325/head
authorSage Weil <sage@newdream.net>
Mon, 19 Apr 2021 14:26:30 +0000 (09:26 -0500)
committerGerald Yang <gerald.yang.tw@gmail.com>
Mon, 27 Sep 2021 07:23:03 +0000 (07:23 +0000)
commit2cb463b915c76db4ed74a342d5795c0ff2b263e6
treea63d0f648af57ffd05289459fc2e183cede34378
parente7680eae4164a9918e20abb4d948a68e5b787892
msgr/async: fix unsafe access in unregister_conn()

We were looking at anon_conns and accepting_conns without holding
the lock (deleted_lock is not sufficient).

Drop this test, and move the decrements:

- inc when we add to conns or anon_conns (no changes there)
- dec when we remove from deleted_conns (several different paths!)

Fixes: https://tracker.ceph.com/issues/49237
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit d51d80b3234e17690061f65dc7e1515f4244a5a3)
Signed-off-by: Gerald Yang <gerald.yang.tw@gmail.com>
src/msg/async/AsyncMessenger.cc
src/msg/async/AsyncMessenger.h