]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: correct tag checking logic in bucket_exports_object 57060/head
authorAlex Wojno <awojno@bloomberg.net>
Fri, 28 Jun 2024 18:32:55 +0000 (14:32 -0400)
committerAlex Wojno <awojno@bloomberg.net>
Fri, 28 Jun 2024 18:32:55 +0000 (14:32 -0400)
Signed-off-by: Alex Wojno <awojno@bloomberg.net>
src/rgw/driver/rados/rgw_bucket_sync.cc
src/rgw/driver/rados/rgw_bucket_sync.h
src/rgw/rgw_op.cc

index 28e35d4bb47cb280c67ba4c21e769e839bbc3dfa..1e7316d4271d6b96160bd399ce92a4c5775e4e72 100644 (file)
@@ -984,12 +984,11 @@ void RGWBucketSyncPolicyHandler::get_pipes(std::set<rgw_sync_bucket_pipe> *_sour
   }
 }
 
-bool RGWBucketSyncPolicyHandler::bucket_exports_object(const std::string& obj_name, const RGWObjTags* tags) const {
+bool RGWBucketSyncPolicyHandler::bucket_exports_object(const std::string& obj_name, const RGWObjTags& tags) const {
   if (bucket_exports_data()) {
     for (auto& entry : target_pipes.pipe_map) {
       auto& filter = entry.second.params.source.filter;
-      if (filter.check_prefix(obj_name) &&
-       (tags == nullptr || filter.check_tags(tags->get_tags()))) {
+      if (filter.check_prefix(obj_name) && filter.check_tags(tags.get_tags())) {
        return true;
       }
     }
index ba578c8371c0646183f8ce8e108a172808a52156..eb3226b704738d2b08f5ed38f7a7a1cb0d54f301 100644 (file)
@@ -402,7 +402,7 @@ public:
     return target_hints;
   }
 
-  bool bucket_exports_object(const std::string& obj_name, const RGWObjTags* tags) const;
+  bool bucket_exports_object(const std::string& obj_name, const RGWObjTags& tags) const;
   bool bucket_exports_data() const;
   bool bucket_imports_data() const;
 
index d2b8b1fdf8ad98793f8b1f0c5039cc5675c78ed4..b42a9e17463d07ab5a2b66d917717b83a841ae6b 100644 (file)
@@ -4481,7 +4481,7 @@ void RGWPutObj::execute(optional_yield y)
     ldpp_dout(this, 0) << "failed to read sync policy for bucket: " << s->bucket << dendl;
     return;
   }
-  if (policy_handler && policy_handler->bucket_exports_object(s->object->get_name(), obj_tags.get())) {
+  if (policy_handler && policy_handler->bucket_exports_object(s->object->get_name(), obj_tags)) {
     bufferlist repl_bl;
     repl_bl.append("PENDING");
     emplace_attr(RGW_ATTR_OBJ_REPLICATION_STATUS, std::move(repl_bl));