From 64fd1b77223724c5f0bf7bd54676d1c41a510662 Mon Sep 17 00:00:00 2001 From: myoungwon oh Date: Wed, 10 Jan 2018 01:01:16 +0900 Subject: [PATCH] osd: fix a vargrind issue Fixes: http://tracker.ceph.com/issues/22641 Signed-off-by: Myoungwon Oh --- src/osd/PrimaryLogPG.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 05385e3c6c7..01c12a32e34 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -8937,13 +8937,15 @@ void PrimaryLogPG::process_copy_chunk_manifest(hobject_t oid, ceph_tid_t tid, in finish_ctx(ctx.get(), pg_log_entry_t::PROMOTE); simple_opc_submit(std::move(ctx)); - auto p = cobc->obs.oi.manifest.chunk_map.end(); + auto p = cobc->obs.oi.manifest.chunk_map.rbegin(); /* check remaining work */ - if (obj_cop->last_offset >= p->first + p->second.length) { - for (auto &en : cobc->obs.oi.manifest.chunk_map) { - if (obj_cop->last_offset < en.first) { - _copy_some_manifest(cobc, obj_cop, en.first); - return; + if (p != cobc->obs.oi.manifest.chunk_map.rend()) { + if (obj_cop->last_offset >= p->first + p->second.length) { + for (auto &en : cobc->obs.oi.manifest.chunk_map) { + if (obj_cop->last_offset < en.first) { + _copy_some_manifest(cobc, obj_cop, en.first); + return; + } } } } -- 2.47.3