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

luminous: osd: do not crash on empty snapset #21638

Merged
merged 1 commit into from May 8, 2018

Conversation

smithfarm
Copy link
Contributor

@smithfarm smithfarm self-assigned this Apr 25, 2018
@smithfarm smithfarm added this to the luminous milestone Apr 25, 2018
@smithfarm smithfarm changed the title luminous: OSD crashes on empty snapset luminous: osd: do not crash on empty snapset Apr 25, 2018
@@ -10190,6 +10190,11 @@ int PrimaryLogPG::find_object_context(const hobject_t& oid,
first = p->second.back();
last = p->second.front();
}
if (p->second.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@smithfarm this needs to be inside the above "else" block. Before first = p->second.back() -- we need to check that we can safely use p->second.back() and p->second.front().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@trociny Oh, right. Fixing.

liewegas
liewegas previously approved these changes Apr 25, 2018
@@ -10189,6 +10189,11 @@ int PrimaryLogPG::find_object_context(const hobject_t& oid,
assert(p != obc->ssc->snapset.clone_snaps.end());
first = p->second.back();
last = p->second.front();
if (p->second.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@smithfarm It should be before first = p->second.back(). Because if p->second is empty, p->second.back() and p->second.front() will trigger segfault.

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit 3996c0a)

Conflicts:
	src/osd/PrimaryLogPG.cc - retain legacy snapshot handling in luminous -
                 i.e., do not backport 89c3439
@smithfarm
Copy link
Contributor Author

Ouch! I was not giving this PR the attention it deserved. Sorry for the trouble!

Copy link
Contributor

@trociny trociny left a comment

Choose a reason for hiding this comment

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

LGTM

@yuriw
Copy link
Contributor

yuriw commented May 7, 2018

@yuriw yuriw merged commit 539c698 into ceph:luminous May 8, 2018
@smithfarm smithfarm deleted the wip-23852-luminous branch May 9, 2018 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants