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

osd: constify OpRequest::get_req(); fix a few cases of operator<< vs mutated message races #13545

Merged
merged 28 commits into from Feb 24, 2017

Conversation

liewegas
Copy link
Member

@liewegas liewegas commented Feb 20, 2017

Try to use const in as many places as possible. In cases where a Message we are processing is really mutated, annotate it by using a different OpRequest accessor (get_nonconst_req()) and make sure that it cannot race with the Message::print() method (used by operator<< and, most importantly, the asok 'ops' command, which may run at any time and must break due to any of our mutations).

I tried to order this so that it would build in sequence but didn't go back and verify. It should be close.

Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
For the handle_pg_create caller we cannot put the ref; do it in the callers
instead.

Signed-off-by: Sage Weil <sage@redhat.com>
(Soon we'll make get_req() const.)

Signed-off-by: Sage Weil <sage@redhat.com>
Make nref mutable, and make a const and non-const get() variant.

Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
The PGLog (merge) code stills the pg_log_t entries, but operator<< (called
by the message printer) doesn't look at it.  Document.

Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
In a few places we copy a bufferlist instead of stealing it.  This is
fast (it just came off the wire and is one buffer).

Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Anybody who needs a mutable pointer should be calling get_nonconst_ref()
and justify themselves.

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