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

luminous: segv in BlueStore::OldExtent::create #24746

Merged
merged 1 commit into from Nov 5, 2018

Conversation

Projects
None yet
3 participants
@smithfarm
Contributor

smithfarm commented Oct 24, 2018

os/bluestore: fix race between SharedBlobSet::lookup and SharedBlob::put
A                             B
SharedBlobSet::lookup()
  takes lock
  nref is not 0
                              SharedBlob::put()
                                --nref
returns SharedBlobRef,
  ++nref
                                takes cache lock
                                SharedBlobSet::remove
                                  takes lock
                                  removes
                                deletes SharedBlob

-> A ends up with a ref to deleted SharedBlob

Fix by verifying that nref is still zero in SharedBlobSet::remove(),
while we are holding the SharedBlobSet::lock.  The lock ensures that we
have increased the ref for the lookup before entering remove, so we can
verify that nref is still zero before removing it.  If not, we have
raced, and put() bails out and does nothing.

Fixes: http://tracker.ceph.com/issues/36526
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 020bd7b)

Conflicts:
	src/os/bluestore/BlueStore.h

@smithfarm smithfarm added this to the luminous milestone Oct 24, 2018

@smithfarm smithfarm requested a review from liewegas Oct 24, 2018

@smithfarm smithfarm added the core label Oct 24, 2018

@yuriw

This comment has been minimized.

Contributor

yuriw commented Oct 31, 2018

@yuriw

This comment has been minimized.

Contributor

yuriw commented Nov 2, 2018

@yuriw yuriw merged commit e1a5ade into ceph:luminous Nov 5, 2018

4 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details

@smithfarm smithfarm deleted the smithfarm:wip-36591-luminous branch Nov 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment