]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: honor the tenant part of rgw_bucket during comparisons. 16796/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 3 Aug 2017 16:40:44 +0000 (12:40 -0400)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 8 Aug 2017 15:30:56 +0000 (11:30 -0400)
Fixes: http://tracker.ceph.com/issues/20897
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/rgw/rgw_common.h

index 6dcdde5be0c38a229836c45247c5bc23b464558e..f6fe7ff763fb0d166161a5fc66e4e024cbb4b5bb 100644 (file)
@@ -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)