]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: should capture seastar::do_with params by reference
authorXuehan Xu <xxhdx1985126@gmail.com>
Wed, 27 Jan 2021 11:04:47 +0000 (19:04 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Thu, 28 Jan 2021 02:44:00 +0000 (10:44 +0800)
The lambda within seastar::do_with need to use lvalue reference as its parameter,
otherwise it would be referencing a variable whose lifecycle ends when lambda finishes
runing

Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/crimson/osd/replicated_recovery_backend.cc

index 0812003bb311a2362bc19435be2d628264f83452..70c268e83aff1c9dfa0c2e7b0788d6e14e18f424 100644 (file)
@@ -357,7 +357,7 @@ seastar::future<PushOp> ReplicatedRecoveryBackend::build_push_op(
                          recovery_info.version,
                          PushOp(),
     [this, &recovery_info, &progress, stat]
-    (auto new_progress, auto available, auto v, auto pop) {
+    (auto& new_progress, auto& available, auto& v, auto& pop) {
     return read_metadata_for_push_op(recovery_info.soid,
                                      progress, new_progress,
                                      v, &pop).then([&](eversion_t local_ver) mutable {