Skip to content

Commit

Permalink
rgw: honor the tenant part of rgw_bucket during comparisons.
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/20897
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
  • Loading branch information
rzarzynski committed Aug 3, 2017
1 parent 24c5dea commit 06cd02f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/rgw/rgw_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1066,10 +1066,16 @@ struct rgw_bucket {
static void generate_test_instances(list<rgw_bucket*>& o);

bool operator<(const rgw_bucket& b) const {
return name.compare(b.name) < 0;
if (tenant == b.tenant) {
return name < b.name;
} else {
return tenant < b.tenant;
}
}

bool operator==(const rgw_bucket& b) const {
return (name == b.name) && (bucket_id == b.bucket_id);
return (tenant == b.tenant) && (name == b.name) && \
(bucket_id == b.bucket_id);
}
};
WRITE_CLASS_ENCODER(rgw_bucket)
Expand Down

0 comments on commit 06cd02f

Please sign in to comment.