From f031046c4d600ce0a0c2c9ad5856dc100b0901fb Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 26 Sep 2012 15:43:56 -0700 Subject: [PATCH] rgw: copy_object should not override ETAG implicitly When copying an object with new attrs, we still need to maintain the ETAG. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_rados.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index a1d4c9da721ef..a77d0aca71a56 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1127,6 +1127,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; } -- 2.39.5