]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: fix strict weak ordering in PeerSpec::operator< 70027/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Wed, 8 Jul 2026 07:00:53 +0000 (15:00 +0800)
committerSun Yuechi <sunyuechi@iscas.ac.cn>
Wed, 8 Jul 2026 11:40:22 +0000 (19:40 +0800)
The mon_host tier branched on "mon_host < rhs.mon_host" but returned the
same comparison, so mon_host > rhs.mon_host fell through to key, both
a < b and b < a could hold.

Only Mirror::m_pool_replayers reaches operator< (via std::pair key).

Fixes: https://tracker.ceph.com/issues/78049
Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
src/tools/rbd_mirror/Types.h

index ef13f20fa9c6cef4d61d6b70d2a345364ade2ecb..da83b62b37453faa4bea16ebcfce5f9c67bc37a7 100644 (file)
@@ -156,7 +156,7 @@ struct PeerSpec {
       return cluster_name < rhs.cluster_name;
     } else if (client_name != rhs.client_name) {
       return client_name < rhs.client_name;
-    } else if (mon_host < rhs.mon_host) {
+    } else if (mon_host != rhs.mon_host) {
       return mon_host < rhs.mon_host;
     } else {
       return key < rhs.key;