From: Radoslaw Zarzynski Date: Fri, 23 Mar 2018 21:46:02 +0000 (+0100) Subject: osd: don't memcpy hobject_t in PrimaryLogPG::close_op_ctx(). X-Git-Tag: v13.1.0~280^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3f3f8a15cb7fb6b99693d1c607b4bdd5acb89432;p=ceph.git osd: don't memcpy hobject_t in PrimaryLogPG::close_op_ctx(). Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index c9a8f880e45f..4f9952c49147 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -814,7 +814,7 @@ protected: */ void release_object_locks( ObcLockManager &lock_manager) { - list > > to_req; + list > > to_req; bool requeue_recovery = false; bool requeue_snaptrim = false; lock_manager.put_locks( @@ -829,7 +829,7 @@ protected: if (!to_req.empty()) { // requeue at front of scrub blocking queue if we are blocked by scrub for (auto &&p: to_req) { - if (write_blocked_by_scrub(p.first.get_head())) { + if (write_blocked_by_scrub(p.first->obs.oi.soid.get_head())) { for (auto& op : p.second) { op->mark_delayed("waiting for scrub"); } diff --git a/src/osd/osd_internal_types.h b/src/osd/osd_internal_types.h index 4217767e677f..57201627e1e3 100644 --- a/src/osd/osd_internal_types.h +++ b/src/osd/osd_internal_types.h @@ -434,10 +434,10 @@ public: } void put_locks( - list > > *to_requeue, + list > > *to_requeue, bool *requeue_recovery, bool *requeue_snaptrimmer) { - for (auto p: locks) { + for (auto& p: locks) { list _to_requeue; p.second.obc->put_lock_type( p.second.type, @@ -445,10 +445,10 @@ public: requeue_recovery, requeue_snaptrimmer); if (to_requeue) { - to_requeue->push_back( - make_pair( - p.second.obc->obs.oi.soid, - std::move(_to_requeue))); + // We can safely std::move here as the whole `locks` is going + // to die just after the loop. + to_requeue->emplace_back(std::move(p.second.obc), + std::move(_to_requeue)); } } locks.clear();