From 170298a1487f4389cf4627e5b10b7b50be9b6413 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 --- 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 5bb0d3988225..5b831fd2fc83 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -7017,7 +7017,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) { @@ -7084,7 +7084,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; }); @@ -7094,7 +7094,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.47.3