From 9bccd831d8be678dcf09c78cab52e88ea8f44e5e Mon Sep 17 00:00:00 2001 From: "Matthew N. Heler" Date: Wed, 25 Mar 2026 20:32:06 -0500 Subject: [PATCH] rgw: always decompress in CopyObject when source is compressed CopyObject skipped decompression when the source was encrypted, passing compressed ciphertext to the write side. The compressor then re-compressed already-compressed data, corrupting the object. The guard was overly broad. It should have checked whether decrypt is available rather than skipping decompress for all encrypted sources. Signed-off-by: Matthew N. Heler --- src/rgw/rgw_op.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index bd3cfe2a4e2d..d4b066caa1d1 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -5946,7 +5946,7 @@ public: } bool src_encrypted = s->src_object->get_attrs().count(RGW_ATTR_CRYPT_MODE); - if (need_decompress && !src_encrypted) { + if (need_decompress) { obj_size = decompress_info.orig_size; s->src_object->set_obj_size(obj_size); static constexpr bool partial_content = false; -- 2.47.3