From: Patrick Donnelly Date: Tue, 14 May 2024 17:53:09 +0000 (-0400) Subject: mds: use regular dispatch for processing beacons X-Git-Tag: v20.0.0~1881^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7fc2a65326eeeef4938a9f73be05b6f66358405f;p=ceph.git mds: use regular dispatch for processing beacons 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 --- diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc index 0fd5f7f1760..059b540feb0 100644 --- a/src/mds/Beacon.cc +++ b/src/mds/Beacon.cc @@ -102,17 +102,6 @@ void Beacon::init(const MDSMap &mdsmap) }); } -bool Beacon::ms_can_fast_dispatch2(const cref_t& m) const -{ - return m->get_type() == MSG_MDS_BEACON; -} - -void Beacon::ms_fast_dispatch2(const ref_t& m) -{ - bool handled = ms_dispatch2(m); - ceph_assert(handled); -} - bool Beacon::ms_dispatch2(const ref_t& m) { dout(25) << __func__ << ": processing " << m << dendl; diff --git a/src/mds/Beacon.h b/src/mds/Beacon.h index 4bf88e403e1..fb7d1cffa29 100644 --- a/src/mds/Beacon.h +++ b/src/mds/Beacon.h @@ -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& m) const override; - void ms_fast_dispatch2(const ref_t& m) override; bool ms_dispatch2(const ref_t &m) override; void ms_handle_connect(Connection *c) override {} bool ms_handle_reset(Connection *c) override {return false;}