]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: fix updating wrong object size
authormyoungwon oh <omwmw@sk.com>
Fri, 22 Dec 2017 11:05:34 +0000 (20:05 +0900)
committermyoungwon oh <omwmw@sk.com>
Sun, 7 Jan 2018 13:42:38 +0000 (22:42 +0900)
Signed-off-by: Myoungwon Oh <omwmw@sk.com>
src/osd/PrimaryLogPG.cc

index 76ccae05a668f65fe0781fa2c517f8122876ecbf..37df921ce329b7a4ab859b5ac6a53c4e3146acf3 100644 (file)
@@ -9795,11 +9795,15 @@ int PrimaryLogPG::try_flush_mark_clean(FlushOpRef fop)
     }
     if (obc->obs.oi.size == chunks_size) { 
       t->truncate(oid, 0);
-      ctx->new_obs.oi.size = 0;
+      interval_set<uint64_t> trim;
+      trim.insert(0, ctx->new_obs.oi.size);
+      ctx->modified_ranges.union_of(trim);
+      truncate_update_size_and_usage(ctx->delta_stats,
+                                    ctx->new_obs.oi,
+                                    0);
       ctx->new_obs.oi.new_object();
       for (auto &p : ctx->new_obs.oi.manifest.chunk_map) {
        p.second.flags = chunk_info_t::FLAG_MISSING;
-       ctx->delta_stats.num_bytes -= p.second.length;
       }
     } else {
       for (auto &p : ctx->new_obs.oi.manifest.chunk_map) {