Skip to content

Commit b91ff3f

Browse files
committed
rgw: fetch_remote_obj() preserves RGW_ATTR_COMPRESSION of encrypted objects
if the source object was both compressed and encrypted, preserve its original compression attribute so it can be decompressed the same way it was originally compressed Signed-off-by: Casey Bodley <[email protected]>
1 parent ea45da7 commit b91ff3f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3402,8 +3402,12 @@ class RGWRadosPutObj : public RGWHTTPStreamRWRequest::ReceiveCB
34023402
try_etag_verify = false;
34033403
}
34043404

3405+
// if the object is both compressed and encrypted, it was transferred
3406+
// in its encrypted+compressed form. we need to preserve the original
3407+
// RGW_ATTR_COMPRESSION instead of falling back to default compression
3408+
// settings
34053409
auto iter = src_attrs.find(RGW_ATTR_COMPRESSION);
3406-
if (iter != src_attrs.end()) {
3410+
if (iter != src_attrs.end() && !encrypted) {
34073411
const bufferlist bl = std::move(iter->second);
34083412
src_attrs.erase(iter); // don't preserve source compression info
34093413

0 commit comments

Comments
 (0)