Project

General

Profile

Actions

Bug #49792

closed

librbd: bug in GroupSnapshotNamespace operator<

Added by xinyan zhang about 3 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
octopus,pacific
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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().


Related issues 2 (0 open2 closed)

Copied to rbd - Backport #54297: octopus: librbd: bug in GroupSnapshotNamespace operator< ResolvedChristopher HoffmanActions
Copied to rbd - Backport #54298: pacific: librbd: bug in GroupSnapshotNamespace operator< ResolvedChristopher HoffmanActions
Actions #1

Updated by Ilya Dryomov about 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Ilya Dryomov
  • Backport set to octopus,pacific
Actions #2

Updated by Ilya Dryomov about 2 years ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 45021
Actions #3

Updated by Ilya Dryomov about 2 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #4

Updated by Backport Bot about 2 years ago

  • Copied to Backport #54297: octopus: librbd: bug in GroupSnapshotNamespace operator< added
Actions #5

Updated by Backport Bot about 2 years ago

  • Copied to Backport #54298: pacific: librbd: bug in GroupSnapshotNamespace operator< added
Actions #6

Updated by Ilya Dryomov almost 2 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF