From afd42666ea8bd3866e8655b7247985aee071abb4 Mon Sep 17 00:00:00 2001 From: jiawd Date: Wed, 17 Nov 2021 09:28:59 +0000 Subject: [PATCH] osd: Adjust code style Fixes: https://tracker.ceph.com/issues/53240 Signed-off-by: jiawd --- src/osd/PrimaryLogPG.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 7c4da28163710..1dc991ea8ce61 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -6740,6 +6740,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) oi.size - op.extent.truncate_size); ctx->modified_ranges.union_of(trim); ctx->clean_regions.mark_data_region_dirty(op.extent.truncate_size, oi.size - op.extent.truncate_size); + oi.clear_data_digest(); } if (op.extent.truncate_size != oi.size) { truncate_update_size_and_usage(ctx->delta_stats, @@ -6765,16 +6766,16 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) if (op.extent.length == 0) { if (op.extent.offset > oi.size) { - if (seq && (seq > op.extent.truncate_seq)) { - //do nothing - //write arrived after truncate, we should not truncate to offset - } else { + if (seq && (seq > op.extent.truncate_seq)) { + //do nothing + //write arrived after truncate, we should not truncate to offset + } else { t->truncate( soid, op.extent.offset); - truncate_update_size_and_usage(ctx->delta_stats, oi, - op.extent.offset); - oi.clear_data_digest(); - } + truncate_update_size_and_usage(ctx->delta_stats, oi, + op.extent.offset); + oi.clear_data_digest(); + } } else { t->nop(soid); } -- 2.39.5