Skip to content

Commit 8ca4fc0

Browse files
committed
crimson/osd/recovery_backend: scan_for_backfill to use seastar::lambda
We could also use here seastar::coroutine::parallel_for_each. However, an `interruptible` overload must be used. Instead, use the coroutine which wrapper is simpler this time. ``` kernel callstack: #0 0x56f6e7a in seastar::lw_shared_ptr<std::map<hobject_t, eversion_t, std::less<hobject_t>, std::allocator<std::pair<hobject_t const, eversion_t> > > >::operator->() const /home/matan/ceph/src/seastar/include/seastar/core/shared_ptr.hh:347 #1 0x56f6e7a in operator() /home/matan/ceph/src/crimson/osd/recovery_backend.cc:245 ceph#2 0x5286c62 in std::__n4861::coroutine_handle<crimson::internal::promise_base<crimson::interruptible::interruptor<crimson::osd::IOInterruptCondition>, void, void> >::resume() const /opt/rh/gcc-toolset-13/root/usr/include/c++/13/coroutine:24 SUMMARY: AddressSanitizer: stack-use-after-return /home/matan/ceph/src/seastar/include/seastar/core/shared_ptr.hh:347 in seastar::lw_shared_ptr<std::map<hobject_t, eversion_t, std::less<hobject_t>, std::allocator<std::pair<hobject_t const, eversion_t> > ``` Signed-off-by: Matan Breizman <[email protected]>
1 parent 6533f26 commit 8ca4fc0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/crimson/osd/recovery_backend.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ RecoveryBackend::scan_for_backfill(
230230
DEBUGDPP("starting from {}", pg, start);
231231
auto version_map = seastar::make_lw_shared<std::map<hobject_t, eversion_t>>();
232232
auto&& [objects, next] = co_await backend->list_objects(start, max);
233-
co_await interruptor::parallel_for_each(objects, [FNAME, this, version_map]
233+
co_await interruptor::parallel_for_each(objects, seastar::coroutine::lambda([FNAME, this, version_map]
234234
(const hobject_t& object) -> interruptible_future<> {
235235
DEBUGDPP("querying obj:{}", pg, object);
236236
auto obc_manager = pg.obc_loader.get_obc_manager(object);
@@ -252,7 +252,7 @@ RecoveryBackend::scan_for_backfill(
252252
// for the first item in the range, which is usually last_backfill.
253253
co_return;
254254
}
255-
});
255+
}));
256256
BackfillInterval bi;
257257
bi.begin = std::move(start);
258258
bi.end = std::move(next);

0 commit comments

Comments
 (0)