]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cls/rbd: GroupSnapshotNamespace comparator violates ordering rules 45076/head
authorIlya Dryomov <idryomov@gmail.com>
Mon, 14 Feb 2022 12:04:00 +0000 (13:04 +0100)
committerChristopher Hoffman <choffman@redhat.com>
Thu, 17 Feb 2022 15:14:26 +0000 (15:14 +0000)
commitaa4dea2381e9cdd6855afacd39096e05d9c3b6e1
tree71d9ebf6a5be77f90e4b7de1236a8dcc58ae9be5
parent7516df7fec9d21581a28fd4addedfd8e4c26f0d9
cls/rbd: GroupSnapshotNamespace comparator violates ordering rules

For

  GroupSnapshotNamespace a(1, "group-1", "snap-2");
  GroupSnapshotNamespace b(1, "group-2", "snap-1");

both a < b and b < a evaluate to true.  This violates STL strict weak
ordering requirements which is a problem because GroupSnapshotNamespace
is used as a key in std::map (ictx->snap_ids at least), etc.

Fixes: https://tracker.ceph.com/issues/49792
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 830e72ab9d66c8f5703ea27da5249b02dd16ccd0)
src/cls/rbd/cls_rbd_types.h