From 41e2d08a798e21cb4723c5ea8d06729fe4de0bc8 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 (cherry picked from commit afd42666ea8bd3866e8655b7247985aee071abb4) --- 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 b489b0449b5..030273da8ec 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -6709,6 +6709,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, @@ -6734,16 +6735,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