From df1d7ccb03243116d81e40e606591fd480ff51e8 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Sun, 19 Feb 2023 17:15:56 -0500 Subject: [PATCH] rgw: don't dereference nullopt in DeleteMultiObj Signed-off-by: Casey Bodley (cherry picked from commit 170298a1487f4389cf4627e5b10b7b50be9b6413) --- src/rgw/rgw_op.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index f62e3687ec569..f5631ce084f5a 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -7189,7 +7189,7 @@ void RGWDeleteMultiObj::execute(optional_yield y) vector::iterator iter; RGWMultiDelXMLParser parser; uint32_t aio_count = 0; - const uint32_t max_aio = s->cct->_conf->rgw_multi_obj_del_max_aio; + const uint32_t max_aio = std::max(1, s->cct->_conf->rgw_multi_obj_del_max_aio); char* buf; std::optional formatter_flush_cond; if (y) { @@ -7256,7 +7256,7 @@ void RGWDeleteMultiObj::execute(optional_yield y) iter != multi_delete->objects.end(); ++iter) { rgw_obj_key obj_key = *iter; - if (y && max_aio > 1) { + if (y) { wait_flush(y, &*formatter_flush_cond, [&aio_count, max_aio] { return aio_count < max_aio; }); @@ -7266,7 +7266,7 @@ void RGWDeleteMultiObj::execute(optional_yield y) aio_count--; }); } else { - handle_individual_object(obj_key, y, &*formatter_flush_cond); + handle_individual_object(obj_key, y, nullptr); } } if (formatter_flush_cond) { -- 2.39.5