From: xie xingguo Date: Tue, 24 Oct 2017 07:40:12 +0000 (+0800) Subject: osd/PrimaryLogPG: update modified_ranges correctly on truncating X-Git-Tag: v13.0.1~411^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F18527%2Fhead;p=ceph.git osd/PrimaryLogPG: update modified_ranges correctly on truncating This is necessary since we are modifying the object contents. Signed-off-by: xie xingguo --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 4ee0ad1e2b34..25955f815483 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -5689,6 +5689,12 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) t->truncate(soid, op.extent.truncate_size); oi.truncate_seq = op.extent.truncate_seq; oi.truncate_size = op.extent.truncate_size; + if (oi.size > op.extent.truncate_size) { + interval_set trim; + trim.insert(op.extent.truncate_size, + oi.size - op.extent.truncate_size); + ctx->modified_ranges.union_of(trim); + } if (op.extent.truncate_size != oi.size) { truncate_update_size_and_usage(ctx->delta_stats, oi,