Skip to content

Commit

Permalink
osd/OSD.cc: don't crash on incorrect injectargs
Browse files Browse the repository at this point in the history
Signed-off-by: Colin McCabe <[email protected]>
  • Loading branch information
cmccabe committed Sep 13, 2011
1 parent 6c81960 commit e86f3bd
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2200,12 +2200,18 @@ void OSD::handle_command(MMonCommand *m)

dout(20) << "handle_command args: " << m->cmd << dendl;
if (m->cmd[0] == "injectargs") {
ostringstream oss;
osd_lock.Unlock();
g_conf->injectargs(m->cmd[1], &oss);
osd_lock.Lock();
derr << "injectargs:" << dendl;
derr << oss.str() << dendl;
if (m->cmd.size() < 2) {
derr << "Ignoring empty injectargs! Perhaps you should add -- before "
<< "your injectargs argument." << dendl;
}
else {
ostringstream oss;
osd_lock.Unlock();
g_conf->injectargs(m->cmd[1], &oss);
osd_lock.Lock();
derr << "injectargs:" << dendl;
derr << oss.str() << dendl;
}
}
else if (m->cmd[0] == "stop") {
dout(0) << "got shutdown" << dendl;
Expand Down

0 comments on commit e86f3bd

Please sign in to comment.