From 405f822518f6a46b22bd969d2e4592697421dc4e Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Wed, 3 Aug 2022 11:36:45 +0000 Subject: [PATCH] crimson/osd/pg: with_clone_obc: avoid coid capture Signed-off-by: Matan Breizman --- src/crimson/osd/pg.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 92f9e8b6e46..c6c3f42b9eb 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -1060,18 +1060,17 @@ PG::with_clone_obc(hobject_t oid, with_obc_func_t&& func) } auto [clone, existed] = shard_services.get_cached_obc(*coid); return clone->template with_lock( - [coid=*coid, existed=existed, - head=std::move(head), clone=std::move(clone), + [existed=existed, head=std::move(head), clone=std::move(clone), func=std::move(func), this]() -> load_obc_iertr::future<> { auto loaded = load_obc_iertr::make_ready_future(clone); if (existed) { - logger().debug("with_clone_obc: found {} in cache", coid); + logger().debug("with_clone_obc: found {} in cache", clone->get_oid()); } else { - logger().debug("with_clone_obc: cache miss on {}", coid); + logger().debug("with_clone_obc: cache miss on {}", clone->get_oid()); loaded = clone->template with_promoted_lock( - [coid, clone, head, this] { - return backend->load_metadata(coid).safe_then_interruptible( - [coid, clone=std::move(clone), head=std::move(head)](auto md) mutable { + [clone, head, this] { + return backend->load_metadata(clone->get_oid()).safe_then_interruptible( + [clone=std::move(clone), head=std::move(head)](auto md) mutable { clone->set_clone_state(std::move(md->os), std::move(head)); return clone; }); -- 2.47.3