From: myoungwon oh Date: Tue, 9 Jan 2018 16:01:16 +0000 (+0900) Subject: osd: fix a vargrind issue X-Git-Tag: v13.0.2~559^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F19874%2Fhead;p=ceph.git osd: fix a vargrind issue Fixes: http://tracker.ceph.com/issues/22641 Signed-off-by: Myoungwon Oh --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 05385e3c6c7a..01c12a32e345 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; + } } } }