]> git.apps.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>
Tue, 26 Sep 2023 05:07:39 +0000 (13:07 +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 ad74ae58af2e1c740b32a06d5fb8006e045c1766..301306263e66ee7093e8279f2563ed4cb588b601 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; }