]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: copy_object should not override ETAG implicitly
authorYehuda Sadeh <yehuda@inktank.com>
Wed, 26 Sep 2012 22:43:56 +0000 (15:43 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Wed, 26 Sep 2012 23:14:02 +0000 (16:14 -0700)
When copying an object with new attrs, we still need to
maintain the ETAG.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_rados.cc

index d9e105074511596ee76b22e1c221725a0b5cc733..713486537d99838df5c441c852ebf726f9ef60dd 100644 (file)
@@ -1175,6 +1175,9 @@ int RGWRados::copy_obj(void *ctx,
   manifest.obj_size = ofs;
 
   if (replace_attrs) {
+    if (!attrs[RGW_ATTR_ETAG].length())
+      attrs[RGW_ATTR_ETAG] = attrset[RGW_ATTR_ETAG];
+
     attrset = attrs;
   }