Skip to content

Commit 7fc2a65

Browse files
committed
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: 7fc04be See-also: linux.git/f7c2f4f6ce16fb58f7d024f3e1b40023c4b43ff9 Fixes: https://tracker.ceph.com/issues/65658 Signed-off-by: Patrick Donnelly <[email protected]>
1 parent b463d93 commit 7fc2a65

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

src/mds/Beacon.cc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,6 @@ void Beacon::init(const MDSMap &mdsmap)
102102
});
103103
}
104104

105-
bool Beacon::ms_can_fast_dispatch2(const cref_t<Message>& m) const
106-
{
107-
return m->get_type() == MSG_MDS_BEACON;
108-
}
109-
110-
void Beacon::ms_fast_dispatch2(const ref_t<Message>& m)
111-
{
112-
bool handled = ms_dispatch2(m);
113-
ceph_assert(handled);
114-
}
115-
116105
bool Beacon::ms_dispatch2(const ref_t<Message>& m)
117106
{
118107
dout(25) << __func__ << ": processing " << m << dendl;

src/mds/Beacon.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ class Beacon : public Dispatcher
5353
void init(const MDSMap &mdsmap);
5454
void shutdown();
5555

56-
bool ms_can_fast_dispatch_any() const override { return true; }
57-
bool ms_can_fast_dispatch2(const cref_t<Message>& m) const override;
58-
void ms_fast_dispatch2(const ref_t<Message>& m) override;
5956
bool ms_dispatch2(const ref_t<Message> &m) override;
6057
void ms_handle_connect(Connection *c) override {}
6158
bool ms_handle_reset(Connection *c) override {return false;}

0 commit comments

Comments
 (0)