From: Samuel Just Date: Wed, 21 Feb 2024 00:43:16 +0000 (-0800) Subject: crimson/.../shard_services.cc: pass by reference from do_with X-Git-Tag: v20.0.0~2562^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F55684%2Fhead;p=ceph.git crimson/.../shard_services.cc: pass by reference from do_with Capturing the value passed by do_with by value causes later captures by reference to be invalid past the lifetime of the lambda frame. Fixes: https://tracker.ceph.com/issues/64513 Signed-off-by: Samuel Just --- diff --git a/src/crimson/osd/shard_services.cc b/src/crimson/osd/shard_services.cc index e20e310dc2cc..8140ca3f91d5 100644 --- a/src/crimson/osd/shard_services.cc +++ b/src/crimson/osd/shard_services.cc @@ -808,7 +808,7 @@ seastar::future> OSDSingletonState::build_incremental_map_msg( crimson::make_message( monc.get_fsid(), osdmap->get_encoding_features()), - [this, &first, FNAME, last](unsigned int map_message_max, + [this, &first, FNAME, last](auto &map_message_max, auto &m) { m->cluster_osdmap_trim_lower_bound = superblock.cluster_osdmap_trim_lower_bound; m->newest_map = superblock.get_newest_map();