From: Casey Bodley Date: Thu, 28 Oct 2021 19:20:26 +0000 (-0400) Subject: rgw: fix self-comparison for RGWCopyObj optimization X-Git-Tag: v17.1.0~523^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ec4f5cd0e15748d9dc7a579a8c731bbfe30a5aef;p=ceph.git rgw: fix self-comparison for RGWCopyObj optimization 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 --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index cf16234849a..e5d452063c3 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -4480,7 +4480,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;