A write_full operation may implicitly truncate the object down,
hence we need to mark the truncated part as dirty as well since
follow-up randomized writes may still be able to (re)extend the
object size and leave some holes against the truncated part,
which as a result might cause problems during incremental-mode
recovery.
Note that write_update_size_and_usage would reset oi.size
and that's why we move the mark_data_region_dirty call before that.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
} else {
obs.oi.clear_data_digest();
}
-
+ ctx->clean_regions.mark_data_region_dirty(0,
+ std::max((uint64_t)op.extent.length, oi.size));
write_update_size_and_usage(ctx->delta_stats, oi, ctx->modified_ranges,
0, op.extent.length, true);
- ctx->clean_regions.mark_data_region_dirty(0, op.extent.length);
}
break;