Actions
Bug #49792
closedlibrbd: bug in GroupSnapshotNamespace operator<
% Done:
0%
Source:
Tags:
Backport:
octopus,pacific
Regression:
No
Severity:
3 - minor
Reviewed:
Description
inline bool operator<(const GroupSnapshotNamespace& gsn) const {
if (group_pool < gsn.group_pool) {
return true;
} else if (group_id < gsn.group_id) {
return true;
} else {
return (group_snapshot_id < gsn.group_snapshot_id);
}
return false;
}
Suppose we got these data:
GroupSnapshotNamespace a(1,"28ae679ce9e8", "955628992537");
GroupSnapshotNamespace b(1,"28ae8436ec3", "1026a31ac3c44");
In this case, a < b is true, b < a is also true.
If a map uses GroupSnapshotNamespace as key, this might cause an unexcepted result in map.find() or map.count().
Actions