]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix use-after-free in SessionMap::remove_session 4755/head
authorYan, Zheng <zyan@redhat.com>
Mon, 25 May 2015 03:35:01 +0000 (11:35 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 25 May 2015 03:46:06 +0000 (11:46 +0800)
Fixes: #11752
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/SessionMap.cc

index cd45b35f18881bbd2b723ef772720d4a06ed2359..faaeb2669d65466548eed64b1c67ab459e306279 100644 (file)
@@ -584,11 +584,11 @@ void SessionMap::remove_session(Session *s)
   s->trim_completed_requests(0);
   s->item_session_list.remove_myself();
   session_map.erase(s->info.inst.name);
-  s->put();
   if (dirty_sessions.count(s->info.inst.name)) {
     dirty_sessions.erase(s->info.inst.name);
   }
   null_sessions.insert(s->info.inst.name);
+  s->put();
 }
 
 void SessionMap::touch_session(Session *session)