Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lock cycle (un)registering asok commands #7581

Merged
merged 2 commits into from Feb 11, 2016

Conversation

jcsp
Copy link
Contributor

@jcsp jcsp commented Feb 9, 2016

Previously, in e.g. Objecter, we had hooks that went AdminSocket::m_lock -> Objecter::rwlock, and then during shutdown, calls to unregister resulted in the opposite lock order. That was genuinely dangerous (not just lockdep noise) because there was nothing stopping a user sending a command at the moment of shutdown and causing a deadlock.

John Spray added 2 commits February 9, 2016 12:18
Otherwise, hooks cannot take any locks which
were held during registration of hooks, because
it creates a cycle.

Signed-off-by: John Spray <john.spray@redhat.com>
unregister blocks until any running hook has
completed, and that running hook might
be one that takes the objecter lock, so you
can't hold it while unregistering.

Signed-off-by: John Spray <john.spray@redhat.com>
@jcsp
Copy link
Contributor Author

jcsp commented Feb 9, 2016

Related test: ceph/ceph-qa-suite#805
This is a follow up to #14365

liewegas added a commit that referenced this pull request Feb 11, 2016
librados: mix lock cycle (un)registering asok commands

Reviewed-by: Sage Weil <sage@redhat.com>
@liewegas liewegas merged commit 0d819d5 into ceph:master Feb 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants