]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: preserve RGW_ATTR_CRYPT_PARTS of already-replicated objects
authorCasey Bodley <cbodley@redhat.com>
Wed, 12 Jul 2023 20:13:34 +0000 (16:13 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 4 Aug 2023 19:11:24 +0000 (15:11 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 902d07499df4ed68721821691e0477e673ab15a5)

src/rgw/rgw_rados.cc

index 66b2d80198770b102a05d3a3d1d98e664dbfe7ca..1c1bce52a50e7ef1886662b8541310d67d079066 100644 (file)
@@ -3493,9 +3493,11 @@ public:
         manifest_bl = std::move(iter->second);
         src_attrs.erase(iter);
 
-        // if the source object was encrypted, preserve the original object's
-        // part lengths
-        if (src_attrs.count(RGW_ATTR_CRYPT_MODE)) {
+        // if the source object was encrypted, preserve the part lengths from
+        // the original object's manifest in RGW_ATTR_CRYPT_PARTS. if the object
+        // already replicated and has the RGW_ATTR_CRYPT_PARTS attr, preserve it
+        if (src_attrs.count(RGW_ATTR_CRYPT_MODE) &&
+            !src_attrs.count(RGW_ATTR_CRYPT_PARTS)) {
           std::vector<size_t> parts_len;
           int r = RGWGetObj_BlockDecrypt::read_manifest_parts(dpp, manifest_bl,
                                                               parts_len);