]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: account for closing sessions in hit_session 37820/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>
Mon, 26 Oct 2020 21:21:28 +0000 (22:21 +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 ae80cef5d4bb1b559c2969d0f685a0826d36c47d..ccd423512f1928fa3bea5228aaef3d81563c5f47 100644 (file)
@@ -1015,7 +1015,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();