From: Casey Bodley Date: Wed, 26 Oct 2016 18:54:37 +0000 (-0400) Subject: rgw: maintain uncompressed size in copy_obj_data X-Git-Tag: v11.1.0~429^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8548241dfdc5e0315b8b34436f5e9d35afa831fe;p=ceph.git rgw: maintain uncompressed size in copy_obj_data Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 61223e8001d5c..919206c3127be 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -7626,10 +7626,20 @@ int RGWRados::copy_obj_data(RGWObjectCtx& obj_ctx, } } - // XXX: need to copy over compression attr and its orig_size here? - ret = processor.complete(ofs, etag, mtime, set_mtime, attrs, delete_at); + // pass original size if compressed + uint64_t accounted_size = ofs; + { + bool compressed{false}; + RGWCompressionInfo cs_info; + ret = rgw_compression_info_from_attrset(attrs, compressed, cs_info); + if (ret < 0) { + ldout(cct, 0) << "ERROR: failed to read compression info" << dendl; + return ret; + } + accounted_size = cs_info.orig_size; + } - return ret; + return processor.complete(accounted_size, etag, mtime, set_mtime, attrs, delete_at); } bool RGWRados::is_meta_master()