From: myoungwon oh Date: Fri, 22 Dec 2017 11:05:34 +0000 (+0900) Subject: osd: fix updating wrong object size X-Git-Tag: v13.0.2~629^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=085f1caadf4a624ac41b17797dd5749c5095af55;p=ceph.git osd: fix updating wrong object size Signed-off-by: Myoungwon Oh --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 76ccae05a668..37df921ce329 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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 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) {