From 41dc60a5f7e82e357b857125cd93f44f1597cbeb Mon Sep 17 00:00:00 2001 From: Sidharth Anupkrishnan Date: Wed, 16 Oct 2019 06:35:51 +0530 Subject: [PATCH] mds: Fix duplicate client entries in list to avoid multiple client evictions Cannot be cherry-picked from master because the container to be changed that's being used in mimic is std::list instead of std::vector Fixes: https://tracker.ceph.com/issues/41585 Signed-off-by: Sidharth Anupkrishnan (manual backport of f4afb43f3649161516f2350df9fd1d918b13736b) --- src/mds/Locker.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index e73454c70f6b3..6125a30e11771 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -3662,7 +3662,10 @@ void Locker::get_late_revoking_clients(std::list *result, // Slow path: execute in O(N_clients) for (auto &p : revoking_caps_by_client) { if (any_late_revoking_caps(p.second, timeout)) { - result->push_back(p.first); + // Search the list for duplicate and only insert if unique + std::list::const_iterator it = std::find(result->begin(), result->end(), p.first); + if (it == result->end()) + result->push_back(p.first); } } } -- 2.39.5