From: Xuehan Xu Date: Wed, 10 Feb 2021 02:37:29 +0000 (+0800) Subject: crimson/osd: capture pgref by value if it is to be referenced asynchronously X-Git-Tag: v17.1.0~3012^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=affa3a6cce547f2e7c7bc92d386814e6a01b2d69;p=ceph.git crimson/osd: capture pgref by value if it is to be referenced asynchronously Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/osd/osd_operations/client_request.cc b/src/crimson/osd/osd_operations/client_request.cc index cab167374d7..ee215c0033f 100644 --- a/src/crimson/osd/osd_operations/client_request.cc +++ b/src/crimson/osd/osd_operations/client_request.cc @@ -118,15 +118,16 @@ seastar::future<> ClientRequest::process_pg_op( seastar::future<> ClientRequest::process_op(Ref &pg) { - return with_blocking_future(handle.enter(pp(*pg).recover_missing)).then([&] { + return with_blocking_future(handle.enter(pp(*pg).recover_missing)).then( + [this, pg]() mutable { return do_recover_missing(pg); - }).then([&] { + }).then([this, pg]() mutable { return with_blocking_future(handle.enter(pp(*pg).get_obc)); - }).then([this, &pg]() -> PG::load_obc_ertr::future<> { + }).then([this, pg]() mutable -> PG::load_obc_ertr::future<> { op_info.set_from_op(&*m, *pg->get_osdmap()); - return pg->with_locked_obc(m, op_info, this, [this, &pg](auto obc) { + return pg->with_locked_obc(m, op_info, this, [this, pg](auto obc) mutable { return with_blocking_future(handle.enter(pp(*pg).process)).then( - [this, &pg, obc] { + [this, pg, obc]() mutable { return do_process(pg, obc); }); }); @@ -177,7 +178,7 @@ ClientRequest::do_process(Ref& pg, crimson::osd::ObjectContextRef obc) } return pg->do_osd_ops(m, obc, op_info).safe_then([this](Ref reply) { return conn->send(std::move(reply)); - }, crimson::ct_error::eagain::handle([this, &pg] { + }, crimson::ct_error::eagain::handle([this, pg]() mutable { return process_op(pg); })); }