]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix a vargrind issue 19874/head
authormyoungwon oh <omwmw@sk.com>
Tue, 9 Jan 2018 16:01:16 +0000 (01:01 +0900)
committermyoungwon oh <omwmw@sk.com>
Tue, 9 Jan 2018 16:01:16 +0000 (01:01 +0900)
Fixes: http://tracker.ceph.com/issues/22641
Signed-off-by: Myoungwon Oh <omwmw@sk.com>
src/osd/PrimaryLogPG.cc

index 05385e3c6c7a0128a4efbe3b41e1e64c70d75c92..01c12a32e345210d4ee9d2092731f871418c4aab 100644 (file)
@@ -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;
+         }
        }
       }
     }