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

common: fix lockdep vs recursive mutexes #9940

Merged
merged 3 commits into from
Mar 23, 2017

Conversation

aclamk
Copy link
Contributor

@aclamk aclamk commented Jun 27, 2016

The problem is that:
Mutex lock("RGWKeystoneTokenCache", true /* recursive */);
Mutex::Locker l(lock);
lock.Lock();
fails...
Signed-off-by: Adam Kupczyk akupczyk@mirantis.com

@liewegas liewegas changed the title When conf "lockdep = true", recursive mutexes always caused check asserts common: fix lockdep vs recursive mutexes Jun 27, 2016
@liewegas
Copy link
Member

Do you mind creating a unit test for this? We don't actually have any lockdep unit tests, but just a few basic ones would be really nice. (e.g., demonstrate that a nonrecursive AA or ABBA will assert, and that a recursive AA is okay. gtest has the assert macros that assert that the test aborts.)

@aclamk
Copy link
Contributor Author

aclamk commented Jun 28, 2016

Ok, I will gladly write some unit tests.

@liewegas
Copy link
Member

liewegas commented Nov 3, 2016

LGTM, but needs a rebase now that we're cmake!

@tchaikov
Copy link
Contributor

@aclamk ping?

@aclamk
Copy link
Contributor Author

aclamk commented Jan 20, 2017

@tchaikov rebased.

*/

#include <common/Mutex.h>
#include "gtest/gtest.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to update the CMakeLists.txt to include this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov: The unittest_mutex_debug is already a part of src/test/common/CMakeLists.txt, lines 191-194. Can you confirm?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aclamk it's "test_mutex_debug.cc" not "test_mutex.cc".

@tchaikov
Copy link
Contributor

could you prefix the title of your commit message with the subcomponent your are changing ? see https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#3-describe-your-changes

@tchaikov
Copy link
Contributor

tchaikov commented Feb 8, 2017

@aclamk f0fe3f6 is already merged in #12947. could you remove it from this PR?

@tchaikov
Copy link
Contributor

tchaikov commented Mar 1, 2017

retest this please.

@tchaikov tchaikov self-assigned this Mar 7, 2017
@liewegas
Copy link
Member

can you drop the ceph-disk patch from this PR please?

Adam Kupczyk added 3 commits March 13, 2017 17:39
…heck asserts.

Signed-off-by: Adam Kupczyk <akupczyk@mirantis.com>
Signed-off-by: Adam Kupczyk <akupczyk@mirantis.com>
Signed-off-by: Adam Kupczyk <akupczyk@mirantis.com>
@aclamk aclamk force-pushed the common-recursive-mutex-fix branch from b8ef1bf to b08d688 Compare March 13, 2017 16:43
@aclamk
Copy link
Contributor Author

aclamk commented Mar 13, 2017

@liewegas Dropped ceph-disk patch. I have no idea how it even could get there....

@tchaikov tchaikov merged commit 136c28f into ceph:master Mar 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants