From: Casey Bodley Date: Sun, 19 Feb 2023 22:15:56 +0000 (-0500) Subject: rgw: don't dereference nullopt in DeleteMultiObj X-Git-Tag: v16.2.13~36^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F49327%2Fhead;p=ceph.git rgw: don't dereference nullopt in DeleteMultiObj Signed-off-by: Casey Bodley (cherry picked from commit 170298a1487f4389cf4627e5b10b7b50be9b6413) --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index f62e3687ec56..f5631ce084f5 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) {