]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: use regular dispatch for processing beacons
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 14 May 2024 17:53:09 +0000 (13:53 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 16 May 2024 01:16:29 +0000 (21:16 -0400)
Similar to the issue with MClientMetrics, beacons should also not be handled
via fast dispatch because it's necessary to acquire Beacon::mutex. This is a
big no-no as it may block one of the Messenger threads leading to improbable
deadlocks or DoS.

Instead, use the normal dispatch where acquiring locks is okay to do.

Fixes: 7fc04be9332704946ba6f0e95cfcd1afc34fc0fe
See-also: linux.git/f7c2f4f6ce16fb58f7d024f3e1b40023c4b43ff9
Fixes: https://tracker.ceph.com/issues/65658
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/Beacon.cc
src/mds/Beacon.h

index 0fd5f7f1760fcf66f85f7cb28f787504381d5b92..059b540feb02ebf9519a864bd96480ca582ae7a2 100644 (file)
@@ -102,17 +102,6 @@ void Beacon::init(const MDSMap &mdsmap)
   });
 }
 
-bool Beacon::ms_can_fast_dispatch2(const cref_t<Message>& m) const
-{
-  return m->get_type() == MSG_MDS_BEACON;
-}
-
-void Beacon::ms_fast_dispatch2(const ref_t<Message>& m)
-{
-  bool handled = ms_dispatch2(m);
-  ceph_assert(handled);
-}
-
 bool Beacon::ms_dispatch2(const ref_t<Message>& m)
 {
   dout(25) << __func__ << ": processing " << m << dendl;
index 4bf88e403e1572256d532336f8e6035ade2424e4..fb7d1cffa2941fddabeb0ed161e5b74ceea279cb 100644 (file)
@@ -53,9 +53,6 @@ public:
   void init(const MDSMap &mdsmap);
   void shutdown();
 
-  bool ms_can_fast_dispatch_any() const override { return true; }
-  bool ms_can_fast_dispatch2(const cref_t<Message>& m) const override;
-  void ms_fast_dispatch2(const ref_t<Message>& m) override;
   bool ms_dispatch2(const ref_t<Message> &m) override;
   void ms_handle_connect(Connection *c) override {}
   bool ms_handle_reset(Connection *c) override {return false;}