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

nautilus: osd: OSDMapRef access by multiple threads is unsafe #27402

Merged
merged 1 commit into from Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/osd/OSD.cc
Expand Up @@ -470,7 +470,7 @@ void OSDService::shutdown()
recovery_request_timer.shutdown();
}

osdmap = OSDMapRef();
publish_map(OSDMapRef());
next_osdmap = OSDMapRef();
}

Expand Down Expand Up @@ -3959,7 +3959,10 @@ int OSD::shutdown()
monc->shutdown();
osd_lock.Unlock();

map_lock.get_write();
osdmap = OSDMapRef();
map_lock.put_write();

for (auto s : shards) {
std::lock_guard l(s->osdmap_lock);
s->shard_osdmap = OSDMapRef();
Expand Down
4 changes: 2 additions & 2 deletions src/osd/PG.cc
Expand Up @@ -4295,7 +4295,7 @@ bool PG::sched_scrub()
time_for_deep = (time_for_deep || deep_coin_flip);

//NODEEP_SCRUB so ignore time initiated deep-scrub
if (osd->osd->get_osdmap()->test_flag(CEPH_OSDMAP_NODEEP_SCRUB) ||
if (get_osdmap()->test_flag(CEPH_OSDMAP_NODEEP_SCRUB) ||
pool.info.has_flag(pg_pool_t::FLAG_NODEEP_SCRUB)) {
time_for_deep = false;
nodeep_scrub = true;
Expand All @@ -4305,7 +4305,7 @@ bool PG::sched_scrub()
ceph_assert(!scrubber.must_deep_scrub);

//NOSCRUB so skip regular scrubs
if ((osd->osd->get_osdmap()->test_flag(CEPH_OSDMAP_NOSCRUB) ||
if ((get_osdmap()->test_flag(CEPH_OSDMAP_NOSCRUB) ||
pool.info.has_flag(pg_pool_t::FLAG_NOSCRUB)) && !time_for_deep) {
if (scrubber.reserved) {
// cancel scrub if it is still in scheduling,
Expand Down