]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: initialize session state, even if we had it already
authorSage Weil <sage@newdream.net>
Thu, 25 Feb 2010 23:48:00 +0000 (15:48 -0800)
committerSage Weil <sage@newdream.net>
Fri, 26 Feb 2010 00:38:14 +0000 (16:38 -0800)
This ensures that eagerly reconnecting clients get set to OPEN
when we replay their session from the journal.

src/mds/SessionMap.h

index c099eaf81c1a7ba65f7d0d8dd2fbc5c0130dfa7a..b3bb32da9f8cb6b732db35a13c7a90567a8b0d6b 100644 (file)
@@ -226,9 +226,11 @@ public:
     return 0;
   }
   Session* get_or_add_open_session(entity_inst_t i) {
+    Session *s;
     if (session_map.count(i.name))
-      return session_map[i.name];
-    Session *s = session_map[i.name] = new Session;
+      s = session_map[i.name];
+    else
+      s = session_map[i.name] = new Session;
     s->inst = i;
     set_state(s, Session::STATE_OPEN);
     s->last_cap_renew = g_clock.now();