See "BlueStore::_do_truncate", bluestore will reset ondisk object size
unconditionally to track truncated size. Hence we must adjust logical
size (and usage) accordingly to match the specified metrics.
Fixes: https://tracker.ceph.com/issues/41601
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit
52caa5b5841e49da3806bd1bf5adce221c42fafb)
if (op.extent.offset > oi.size) {
t->truncate(
soid, op.extent.offset);
+ truncate_update_size_and_usage(ctx->delta_stats, oi,
+ op.extent.offset);
} else {
t->nop(soid);
}