From 8513740dda449237d46d5e1aa913b41c81552e78 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Tue, 3 Sep 2019 09:59:40 +0800 Subject: [PATCH] osd/PrimaryLogPG: update oi.size on write op implicitly truncating object up 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 (cherry picked from commit 52caa5b5841e49da3806bd1bf5adce221c42fafb) --- src/osd/PrimaryLogPG.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 0a0c2967fe0b1..c42c077185505 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -6465,6 +6465,8 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) 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); } -- 2.39.5