From: Matthew N. Heler Date: Thu, 26 Feb 2026 21:14:29 +0000 (-0600) Subject: rgw/cloud-restore: strip quotes from ETag on cloud tier fetch X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=35b4ef415fdfa697b00e49eceeb64bd1821ccbbc;p=ceph.git rgw/cloud-restore: strip quotes from ETag on cloud tier fetch When objects are restored from a cloud endpoint, the ETag value read from the HTTP response includes surrounding double-quotes per RFC 7232. RGW stores ETags unquoted internally, and dump_etag() adds its own quotes when serving responses. The mismatch results in double-quoted ETags like ""abc123-6"" on restored objects. Strip the quotes from both the etag output parameter and the RGW_ATTR_ETAG attribute after fetching from the cloud endpoint, matching the unquoted format RGW uses everywhere else. Signed-off-by: Matthew N. Heler --- diff --git a/src/rgw/driver/rados/rgw_lc_tier.cc b/src/rgw/driver/rados/rgw_lc_tier.cc index 15aa5653652e..c483ae4b7a06 100644 --- a/src/rgw/driver/rados/rgw_lc_tier.cc +++ b/src/rgw/driver/rados/rgw_lc_tier.cc @@ -405,6 +405,19 @@ int rgw_cloud_tier_get_object(RGWLCCloudTierCtx& tier_ctx, bool head, } } + /* + * The HTTP ETag header value is a quoted-string per RFC 7232. + * Strip the surrounding quotes so we do not double quote them. + */ + etag = rgw_string_unquote(etag); + + if (auto i = attrs.find(RGW_ATTR_ETAG); i != attrs.end()) { + const string unquoted = rgw_string_unquote(i->second.to_str()); + bufferlist bl; + bl.append(unquoted); + i->second = std::move(bl); + } + ldpp_dout(tier_ctx.dpp, 20) << __func__ << "(): Successfully fetched object from cloud bucket:" << dest_bucket << ", object: " << target_obj_name << dendl; return ret; }