]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: always decompress in CopyObject when source is compressed 68011/head
authorMatthew N. Heler <matthew.heler@hotmail.com>
Thu, 26 Mar 2026 01:32:06 +0000 (20:32 -0500)
committerMatthew N. Heler <matthew.heler@hotmail.com>
Thu, 26 Mar 2026 02:11:13 +0000 (21:11 -0500)
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 <matthew.heler@hotmail.com>
src/rgw/rgw_op.cc

index bd3cfe2a4e2d60b8f198d4d033b2761140cc8125..d4b066caa1d1705874e5db8259d0275fcc6efe70 100644 (file)
@@ -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;