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

osd: exit(1) directly without lock if init fails #16647

Merged
merged 1 commit into from
Aug 21, 2017
Merged
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
19 changes: 4 additions & 15 deletions src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2628,39 +2628,30 @@ int OSD::init()
if (r < 0) {
derr << __func__ << " authentication failed: " << cpp_strerror(r)
<< dendl;
osd_lock.Lock(); // locker is going to unlock this on function exit
if (is_stopping())
r = 0;
goto monout;
exit(1);
}

while (monc->wait_auth_rotating(30.0) < 0) {
derr << "unable to obtain rotating service keys; retrying" << dendl;
++rotating_auth_attempts;
if (rotating_auth_attempts > g_conf->max_rotating_auth_attempts) {
derr << __func__ << " wait_auth_rotating timed out" << dendl;
osd_lock.Lock(); // make locker happy
if (!is_stopping()) {
r = -ETIMEDOUT;
}
goto monout;
exit(1);
}
}

r = update_crush_device_class();
if (r < 0) {
derr << __func__ << " unable to update_crush_device_class: "
<< cpp_strerror(r) << dendl;
osd_lock.Lock();
goto monout;
exit(1);
}

r = update_crush_location();
if (r < 0) {
derr << __func__ << " unable to update_crush_location: "
<< cpp_strerror(r) << dendl;
osd_lock.Lock();
goto monout;
exit(1);
}

osd_lock.Lock();
Expand Down Expand Up @@ -2693,8 +2684,6 @@ int OSD::init()
start_boot();

return 0;
monout:
exit(1);

out:
enable_disable_fuse(true);
Expand Down