]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: ignore MAuth message when connection has no session
authorSage Weil <sage@newdream.net>
Tue, 10 Nov 2009 05:31:51 +0000 (21:31 -0800)
committerSage Weil <sage@newdream.net>
Tue, 10 Nov 2009 05:31:51 +0000 (21:31 -0800)
This happens if hte message is delayed, and the session meanwhile
is closed.  We need similar checks any time we take a Session
from the message->get_connection()....

src/mon/AuthMonitor.cc
src/mon/MonClient.cc
src/mon/Monitor.cc

index cb28aed5946b8ba92b37ee76704fb173748b3d75..3b01b837a52a26d93fc649171d0621af52252630 100644 (file)
@@ -359,6 +359,11 @@ bool AuthMonitor::prep_auth(MAuth *m, bool paxos_writable)
   MAuthReply *reply;
 
   Session *s = (Session *)m->get_connection()->get_priv();
+  if (!s) {
+    dout(10) << "no session, dropping" << dendl;
+    delete m;
+    return true;
+  }
 
   bufferlist response_bl;
   bufferlist::iterator indata = m->auth_payload.begin();
index 7a99f4d702f627dd412705839e26629646435f61..c463eefd68e80ace8c9264aa4a47a99d2a49e4a7 100644 (file)
@@ -295,7 +295,7 @@ void MonClient::handle_auth(MAuthReply *m)
       ::decode(global_id, p);
       clientid = global_id;
       auth->set_global_id(global_id);
-      dout(1) << "my global_id is " << global_id << dendl;
+      dout(10) << "my global_id is " << global_id << dendl;
     } catch (buffer::error *err) {
       delete m;
       return;
index 688ecae22705d8d9c7d7fa7ef14593565f24947d..93c98d0972a320cb36fd48373079377a7f697b0f 100644 (file)
@@ -683,6 +683,11 @@ void Monitor::handle_subscribe(MMonSubscribe *m)
   bool reply = false;
 
   Session *s = (Session *)m->get_connection()->get_priv();
+  if (!s) {
+    dout(10) << " no session, dropping" << dendl;
+    delete m;
+    return;
+  }
 
   s->until = g_clock.now();
   s->until += g_conf.mon_subscribe_interval;