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

librados: handle failed watch registration better #3494

Closed
wants to merge 2 commits into from
Closed

Conversation

jdurgin
Copy link
Member

@jdurgin jdurgin commented Jan 27, 2015

If watch() failed, the LingerOp would be deleted, but a pointer to it
would live on in the handle passed by the caller. An unwatch() called
on that handle would cause a segfault.

Set handle only after the watch osd op has returned, and set it to 0
on failure. Make unwatch() return 0 early if passed a handle of 0, to
get back the earlier behavior of not segfaulting if a non-registered
cookie is passed to unwatch(). This aspect of the interface changed
when the new watch2/notify2 functions were introduced.

If watch() failed, the LingerOp would be deleted, but a pointer to it
would live on in the handle passed by the caller. An unwatch() called
on that handle would cause a segfault.

Set handle only after the watch osd op has returned, and set it to 0
on failure. Make unwatch() return 0 early if passed a handle of 0, to
get back the earlier behavior of not segfaulting if a non-registered
cookie is passed to unwatch(). This aspect of the interface changed
when the new watch2/notify2 functions were introduced.

Fixes #10644
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
The bug this was working around was fixed a while ago.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
@loic-bot
Copy link

SUCCESS: the output of run-make-check.sh on centos-centos7 for b1146ec is http://paste2.org/_wDmzbb9s

:octocat: Sent from GH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants