From e8bffab51abec20b31ceea61ecddbef4dbe26b1e Mon Sep 17 00:00:00 2001 From: myoungwon oh Date: Thu, 12 Oct 2017 01:43:37 +0900 Subject: [PATCH] osd: fix reference a deleted item move() delete to_process' entries. This commit will prevent referencing a deleted item Signed-off-by: Myoungwon Oh --- src/osd/OSD.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 39404f7ddb0b..9fbeaac3dbcf 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -9488,14 +9488,14 @@ void OSD::ShardedOpWQ::wake_pg_waiters(spg_t pgid) dout(20) << __func__ << " " << pgid << " to_process " << p->second.to_process << " waiting_for_pg=" << (int)p->second.waiting_for_pg << dendl; + for (auto& q : p->second.to_process) { + pushes_to_free += q.get_reserved_pushes(); + } for (auto i = p->second.to_process.rbegin(); i != p->second.to_process.rend(); ++i) { sdata->_enqueue_front(std::move(*i), osd->op_prio_cutoff); } - for (auto& q : p->second.to_process) { - pushes_to_free += q.get_reserved_pushes(); - } p->second.to_process.clear(); p->second.waiting_for_pg = false; ++p->second.requeue_seq; -- 2.47.3