]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: update modified_ranges correctly on truncating 18527/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 24 Oct 2017 07:40:12 +0000 (15:40 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 24 Oct 2017 07:45:27 +0000 (15:45 +0800)
This is necessary since we are modifying the object contents.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/PrimaryLogPG.cc

index 4ee0ad1e2b341b95c5d9204817f2739eb1c3cac2..25955f815483d3e33ab5bf3a19cfbcb043c60538 100644 (file)
@@ -5689,6 +5689,12 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& 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<uint64_t> 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,