From: myoungwon oh Date: Thu, 19 Feb 2026 05:01:22 +0000 (+0900) Subject: crimson/os/seastore: use do_with to avoid stack-use-after-return X-Git-Tag: v21.0.0~44^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ffb915630b701dee983459a4634b16c7f2361d6;p=ceph.git crimson/os/seastore: use do_with to avoid stack-use-after-return Signed-off-by: Myoungwon Oh --- diff --git a/src/crimson/os/seastore/seastore.cc b/src/crimson/os/seastore/seastore.cc index 66853ea5a38f..c84583fc07e6 100644 --- a/src/crimson/os/seastore/seastore.cc +++ b/src/crimson/os/seastore/seastore.cc @@ -1919,13 +1919,16 @@ SeaStore::Shard::_do_transaction_step( if (op->hint & CEPH_OSD_ALLOC_HINT_FLAG_LOG) { ceph_assert(get_omap_root(omap_type_t::LOG, *onode).is_null()); ceph_assert(get_omap_root(omap_type_t::OMAP, *onode).is_null()); - auto mgr = crimson::os::seastore::log_manager::LogManager(*transaction_manager); - return mgr.initialize_omap( - *ctx.transaction, - onode->get_metadata_hint(device->get_block_size()), - omap_type_t::LOG - ).si_then([&onode, &ctx](auto new_root) { - onode->update_omap_root(*ctx.transaction, new_root); + return seastar::do_with( + crimson::os::seastore::log_manager::LogManager(*transaction_manager), + [&onode, &ctx, this](auto& mgr) { + return mgr.initialize_omap( + *ctx.transaction, + onode->get_metadata_hint(device->get_block_size()), + omap_type_t::LOG + ).si_then([&onode, &ctx](auto new_root) { + onode->update_omap_root(*ctx.transaction, new_root); + }); }); } return tm_iertr::now();