From f64fb939af0074eb298dc60546e2b3146d92666e Mon Sep 17 00:00:00 2001 From: Pritha Srivastava Date: Wed, 9 Aug 2023 15:17:29 +0530 Subject: [PATCH] rgw/cache: fixing the segmentation fault by passing in 'yield' by value to async_completion. Signed-off-by: Pritha Srivastava --- src/rgw/rgw_ssd_driver.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_ssd_driver.cc b/src/rgw/rgw_ssd_driver.cc index ba43662097a..8aa7466e328 100644 --- a/src/rgw/rgw_ssd_driver.cc +++ b/src/rgw/rgw_ssd_driver.cc @@ -517,7 +517,8 @@ int SSDDriver::delete_attr(const DoutPrefixProvider* dpp, const std::string& key void SSDCacheAioRequest::cache_aio_read(const DoutPrefixProvider* dpp, optional_yield y, const std::string& key, off_t ofs, uint64_t len, rgw::Aio* aio, rgw::AioResult& r) { using namespace boost::asio; - async_completion init(y.get_yield_context()); + spawn::yield_context yield = y.get_yield_context(); + async_completion init(yield); auto ex = get_associated_executor(init.completion_handler); ldpp_dout(dpp, 20) << "SSDCache: " << __func__ << "(): key=" << key << dendl; -- 2.39.5