From: Sage Weil Date: Mon, 21 Nov 2011 21:28:36 +0000 (-0800) Subject: osd: fix 'stop' command X-Git-Tag: v0.39~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3c8fec2d336917a9a016edd0a20c1a411270cb08;p=ceph-ci.git osd: fix 'stop' command Special case. We can't join the command_tp thread from itself. Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index aeba6b8a513..8670ebb55b6 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2240,6 +2240,14 @@ void OSD::handle_command(MMonCommand *m) { if (!require_mon_peer(m)) return; + + // special case shutdown, since shutdown() stops the command_tp + if (m->cmd[0] == "stop") { + shutdown(); + m->put(); + return; + } + Command *c = new Command(m->cmd, m->get_tid(), m->get_data(), NULL); command_wq.queue(c); m->put(); @@ -2264,6 +2272,13 @@ void OSD::handle_command(MCommand *m) return; } + // special case shutdown, since shutdown() stops the command_tp + if (m->cmd[0] == "stop") { + shutdown(); + m->put(); + return; + } + Command *c = new Command(m->cmd, m->get_tid(), m->get_data(), con); command_wq.queue(c);