From 71dd44575b89b686066fedb45c8f6774b5c36db2 Mon Sep 17 00:00:00 2001 From: Sidharth Anupkrishnan Date: Wed, 16 Oct 2019 06:54:08 +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 nautilus 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 5239dd270f0c7..f00b97910054f 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -3620,7 +3620,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