]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: check the xlists in ~MetaSession()
authorXiubo Li <xiubli@redhat.com>
Thu, 6 Jul 2023 07:38:49 +0000 (15:38 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 1 Nov 2023 01:21:06 +0000 (09:21 +0800)
This will crash the clients more gracefully instead of in ~xlist(),
and this will be easier to debug the root cause and get to know
exactly which list is not empty.

Fixes: https://tracker.ceph.com/issues/56698
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 687d4b77e5615e4a76da862c1286eb1d6bb9f559)

src/client/MetaSession.h

index 6c6250502253dc4c7b21d5ec634bc2d54c20f459..89a179981fcfdd8ea9e63b19de9efff59e2a2077 100644 (file)
@@ -62,6 +62,13 @@ struct MetaSession {
   MetaSession(mds_rank_t mds_num, ConnectionRef con, const entity_addrvec_t& addrs)
     : mds_num(mds_num), con(con), addrs(addrs) {
   }
+  ~MetaSession() {
+    ceph_assert(caps.empty());
+    ceph_assert(dirty_list.empty());
+    ceph_assert(flushing_caps.empty());
+    ceph_assert(requests.empty());
+    ceph_assert(unsafe_requests.empty());
+  }
 
   xlist<Inode*> &get_dirty_list() { return dirty_list; }