msgr/async: fix unsafe access in unregister_conn()#40912
Merged
tchaikov merged 1 commit intoceph:masterfrom Apr 22, 2021
Merged
msgr/async: fix unsafe access in unregister_conn()#40912tchaikov merged 1 commit intoceph:masterfrom
tchaikov merged 1 commit intoceph:masterfrom
Conversation
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>
tchaikov
reviewed
Apr 20, 2021
tchaikov
approved these changes
Apr 22, 2021
Member
|
Causes a regression apparently: https://tracker.ceph.com/issues/50622 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We were looking at anon_conns and accepting_conns without holding
the lock (deleted_lock is not sufficient).
Drop this test.
Replace all of the active_connections count updates with a set() set
conns.size() + anon_conns.size() (size() is cheap on a set<>) and the
invariant is clear and easy to maintain.
Fixes: https://tracker.ceph.com/issues/49237
Signed-off-by: Sage Weil sage@newdream.net