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 <sanupkri@redhat.com>
(manual backport of
f4afb43f3649161516f2350df9fd1d918b13736b)
// 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<client_t>::const_iterator it = std::find(result->begin(), result->end(), p.first);
+ if (it == result->end())
+ result->push_back(p.first);
}
}
}