Skip to content

Commit 26b82db

Browse files
authored
Merge pull request ceph#58708 from xxhdx1985126/wip-67068
crimson/osd/osd_operation/client_request: requeue client requests from a temporary queue other than ClientRequest::Orderer::list Reviewed-by: Matan Breizman <[email protected]>
2 parents d91864f + 876ceab commit 26b82db

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/crimson/osd/osd_operations/client_request.cc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,18 @@ namespace crimson::osd {
2323
void ClientRequest::Orderer::requeue(Ref<PG> pg)
2424
{
2525
LOG_PREFIX(ClientRequest::Orderer::requeue);
26-
for (auto &req: list) {
27-
DEBUGDPP("requeueing {}", *pg, req);
28-
req.reset_instance_handle();
29-
std::ignore = req.with_pg_process(pg);
26+
std::list<ClientRequest*> to_requeue;
27+
for (auto &req : list) {
28+
to_requeue.emplace_back(&req);
29+
}
30+
// Client requests might be destroyed in the following
31+
// iteration leading to short lived dangling pointers
32+
// to those requests, but this doesn't hurt as we won't
33+
// dereference those dangling pointers.
34+
for (auto req: to_requeue) {
35+
DEBUGDPP("requeueing {}", *pg, *req);
36+
req->reset_instance_handle();
37+
std::ignore = req->with_pg_process(pg);
3038
}
3139
}
3240

0 commit comments

Comments
 (0)