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

journal: don't hold future lock during assignment #13033

Merged
merged 1 commit into from Jan 22, 2017

Conversation

dillaman
Copy link

It's possible that the future raced with its owner and reaches
an empty reference count. This was resulting in the future being
destructed while its lock was still held.

Fixes: http://tracker.ceph.com/issues/18618
Signed-off-by: Jason Dillaman dillaman@redhat.com

Mutex::Locker locker(prev_future->m_lock);
future = std::move(prev_future->prepare_flush(&flush_handlers));
}
prev_future = std::move(future);
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM. Though wouldn't it be a little more readable if we provide both prepare_flush "locked" and "unlocked" methods and just use "unlocked" one here?

It's possible that the future raced with its owner and reaches
an empty reference count. This was resulting in the future being
destructed while its lock was still held.

Fixes: http://tracker.ceph.com/issues/18618
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
@trociny trociny merged commit fce69f6 into ceph:master Jan 22, 2017
@dillaman dillaman deleted the wip-18618 branch January 22, 2017 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants