mirror of
https://github.com/ceph/ceph
synced 2025-02-24 11:37:37 +00:00
osd/PrimaryLogPG: update modified_ranges correctly on truncating
This is necessary since we are modifying the object contents. Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
parent
f82228c4af
commit
c84d613370
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user