]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix self-comparison for RGWCopyObj optimization 43802/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 28 Oct 2021 19:20:26 +0000 (15:20 -0400)
committerRob Haverkamp <r.haverkamp@42on.com>
Thu, 4 Nov 2021 12:42:12 +0000 (13:42 +0100)
when RGWCopyObj is copying an object onto itself (for example,
's3cmd modify' does this to add/remove metadata), we can avoid
the need to increment the reference count of each tail object.
this self-comparison check was broken during zipper refactoring,
comparing raw pointers instead of the object keys

Fixes: https://tracker.ceph.com/issues/53003
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit ec4f5cd0e15748d9dc7a579a8c731bbfe30a5aef)

src/rgw/rgw_rados.cc

index 3bee2203ce1e99d83871449033bd491da2b586bb..62c8d315f8da550f49ac0d9dc1257ff93a705b36 100644 (file)
@@ -4357,7 +4357,7 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
 
   bufferlist first_chunk;
 
-  bool copy_itself = (dest_obj == src_obj);
+  const bool copy_itself = (dest_obj->get_obj() == src_obj->get_obj());
   RGWObjManifest *pmanifest; 
   ldpp_dout(dpp, 20) << "dest_obj=" << dest_obj << " src_obj=" << src_obj << " copy_itself=" << (int)copy_itself << dendl;