From fc8d1980495c7ba13edd59929e65071fcd396f70 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 1 Jul 2014 15:44:11 -0700 Subject: [PATCH] osd: debug Session refs Signed-off-by: Sage Weil --- src/osd/OSD.cc | 6 +++--- src/osd/OSD.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index b396e12366e..6006165f646 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -3691,7 +3691,7 @@ void OSD::ms_handle_fast_connect(Connection *con) if (con->get_peer_type() != CEPH_ENTITY_TYPE_MON) { Session *s = static_cast(con->get_priv()); if (!s) { - s = new Session; + s = new Session(cct); con->set_priv(s->get()); s->con = con; dout(10) << " new session (outgoing)" << s << " con=" << s->con @@ -3709,7 +3709,7 @@ void OSD::ms_handle_fast_accept(Connection *con) if (con->get_peer_type() != CEPH_ENTITY_TYPE_MON) { Session *s = static_cast(con->get_priv()); if (!s) { - s = new Session(); + s = new Session(cct); con->set_priv(s->get()); s->con = con; dout(10) << "new session (incoming)" << s << " con=" << con @@ -5142,7 +5142,7 @@ bool OSD::ms_verify_authorizer(Connection *con, int peer_type, if (isvalid) { Session *s = static_cast(con->get_priv()); if (!s) { - s = new Session; + s = new Session(cct); con->set_priv(s->get()); s->con = con; dout(10) << " new session " << s << " con=" << s->con << " addr=" << s->con->get_peer_addr() << dendl; diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 428f903bb61..cbac62ab6da 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1152,7 +1152,8 @@ public: Mutex received_map_lock; epoch_t received_map_epoch; // largest epoch seen in MOSDMap from here - Session() : + Session(CephContext *cct) : + RefCountedObject(cct), auid(-1), con(0), session_dispatch_lock("Session::session_dispatch_lock"), sent_epoch_lock("Session::sent_epoch_lock"), last_sent_epoch(0),