From: Radoslaw Zarzynski Date: Thu, 3 Aug 2017 16:40:44 +0000 (-0400) Subject: rgw: honor the tenant part of rgw_bucket during comparisons. X-Git-Tag: v13.0.0~179^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=89c0eb7e67c9ee136c7bd1b81bd69b35a00c5f94;p=ceph.git rgw: honor the tenant part of rgw_bucket during comparisons. Fixes: http://tracker.ceph.com/issues/20897 Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 6dcdde5be0c..f6fe7ff763f 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -1066,10 +1066,16 @@ struct rgw_bucket { static void generate_test_instances(list& 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)