]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: account for closing sessions in hit_session 37856/head
authorDan van der Ster <daniel.vanderster@cern.ch>
Tue, 13 Oct 2020 07:08:12 +0000 (09:08 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 27 Oct 2020 09:36:47 +0000 (10:36 +0100)
While stopping an mds we can reply to a request while all client
sessions are closing. We shouldn't assert in this case.

Fixes: https://tracker.ceph.com/issues/47833
Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
(cherry picked from commit 6823d8fb619c07b4e749ae564df565eadc59c187)

src/mds/SessionMap.cc

index 317e04ef1d25297c74dff644cba291efc9a68b8f..1910f04f061a8ee1d6ddf2a9feee653b6951ddf0 100644 (file)
@@ -1017,7 +1017,8 @@ int Session::check_access(CInode *in, unsigned mask,
 // track total and per session load
 void SessionMap::hit_session(Session *session) {
   uint64_t sessions = get_session_count_in_state(Session::STATE_OPEN) +
-                      get_session_count_in_state(Session::STATE_STALE);
+                      get_session_count_in_state(Session::STATE_STALE) +
+                      get_session_count_in_state(Session::STATE_CLOSING);
   ceph_assert(sessions != 0);
 
   double total_load = total_load_avg.hit();