From d0c9798eb5fd2f0694e395dbfed08ef33fc63657 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 10 Oct 2018 15:54:11 -0400 Subject: [PATCH] rgw: temporarily disable putobj filters Signed-off-by: Casey Bodley --- src/rgw/rgw_file.cc | 20 +++++++++++--------- src/rgw/rgw_op.cc | 14 ++++++++------ src/rgw/rgw_rados.cc | 2 ++ src/rgw/rgw_rest_s3.cc | 6 ++++++ 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index 9a163bafbd435..ec20ff962ecc0 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -1324,16 +1324,18 @@ namespace rgw { } filter = processor; +#if 0 if (compression_type != "none") { plugin = Compressor::create(s->cct, compression_type); - if (! plugin) { - ldout(s->cct, 1) << "Cannot load plugin for rgw_compression_type " - << compression_type << dendl; - } else { - compressor.emplace(s->cct, plugin, filter); - filter = &*compressor; + if (! plugin) { + ldout(s->cct, 1) << "Cannot load plugin for rgw_compression_type " + << compression_type << dendl; + } else { + compressor.emplace(s->cct, plugin, filter); + filter = &*compressor; + } } - } +#endif done: return op_ret; @@ -1396,13 +1398,13 @@ namespace rgw { << op_ret << dendl; goto done; } - +#if 0 /* restore compression filter, if any */ if (compressor) { compressor.emplace(s->cct, plugin, filter); filter = &*compressor; } - +#endif op_ret = put_data_and_throttle(filter, data, ofs, false); if (op_ret < 0) { goto done; diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index ce754077536c4..fc913222f22cd 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -3662,7 +3662,7 @@ void RGWPutObj::execute() } fst = copy_source_range_fst; - +#if 0 op_ret = get_encrypt_filter(&encrypt, filter); if (op_ret < 0) { return; @@ -3682,7 +3682,7 @@ void RGWPutObj::execute() } } } - +#endif tracepoint(rgw_op, before_data_transfer, s->req_id.c_str()); do { bufferlist data; @@ -3751,7 +3751,7 @@ void RGWPutObj::execute() << op_ret << dendl; return; } - +#if 0 op_ret = get_encrypt_filter(&encrypt, filter); if (op_ret < 0) { return; @@ -3764,6 +3764,7 @@ void RGWPutObj::execute() filter = &*compressor; } } +#endif op_ret = put_data_and_throttle(filter, data, ofs, false); if (op_ret < 0) { return; @@ -4011,7 +4012,7 @@ void RGWPostObj::execute() if (op_ret < 0) { return; } - +#if 0 op_ret = get_encrypt_filter(&encrypt, filter); if (op_ret < 0) { return; @@ -4032,7 +4033,7 @@ void RGWPostObj::execute() } } } - +#endif bool again; do { ceph::bufferlist data; @@ -6779,6 +6780,7 @@ int RGWBulkUploadOp::handle_file(const boost::string_ref path, const auto& compression_type = store->get_zone_params().get_compression_type( binfo.placement_rule); CompressorRef plugin; +#if 0 if (compression_type != "none") { plugin = Compressor::create(s->cct, compression_type); if (! plugin) { @@ -6789,7 +6791,7 @@ int RGWBulkUploadOp::handle_file(const boost::string_ref path, filter = &*compressor; } } - +#endif /* Upload file content. */ ssize_t len = 0; size_t ofs = 0; diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index dd36a180924f5..2154b040bd88c 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -7619,10 +7619,12 @@ public: if (plugin && src_attrs.find(RGW_ATTR_CRYPT_MODE) == src_attrs.end()) { //do not compress if object is encrypted +#if 0 compressor = boost::in_place(cct, plugin, filter); constexpr unsigned buffer_size = 512 * 1024; buffering = boost::in_place(&*compressor, buffer_size); filter = &*buffering; +#endif } return 0; } diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 29dc1d1af9eae..e5fa7b09265d4 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -1560,9 +1560,11 @@ int RGWPutObj_ObjStore_S3::get_encrypt_filter( /* We are adding to existing object. * We use crypto mode that configured as if we were decrypting. */ res = rgw_s3_prepare_decrypt(s, xattrs, &block_crypt, crypt_http_responses); +#if 0 if (res == 0 && block_crypt != nullptr) *filter = std::unique_ptr( new RGWPutObj_BlockEncrypt(s->cct, cb, std::move(block_crypt))); +#endif } } /* it is ok, to not have encryption at all */ @@ -1571,10 +1573,12 @@ int RGWPutObj_ObjStore_S3::get_encrypt_filter( { std::unique_ptr block_crypt; res = rgw_s3_prepare_encrypt(s, attrs, nullptr, &block_crypt, crypt_http_responses); +#if 0 if (res == 0 && block_crypt != nullptr) { *filter = std::unique_ptr( new RGWPutObj_BlockEncrypt(s->cct, cb, std::move(block_crypt))); } +#endif } return res; } @@ -2085,12 +2089,14 @@ int RGWPostObj_ObjStore_S3::get_encrypt_filter( int res = 0; std::unique_ptr block_crypt; res = rgw_s3_prepare_encrypt(s, attrs, &parts, &block_crypt, crypt_http_responses); +#if 0 if (res == 0 && block_crypt != nullptr) { *filter = std::unique_ptr( new RGWPutObj_BlockEncrypt(s->cct, cb, std::move(block_crypt))); } else *filter = nullptr; +#endif return res; } -- 2.39.5