From 8bfbcf6944ed48a0f5b9d665947ebf10b4191e33 Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Fri, 24 Jul 2015 13:39:10 +0800 Subject: [PATCH] osd/ReplicatedPG:Optimize judgement when calc crc for read whole object. If extent.length == oi.size, this mean read success and read the whole object. No need other conditions. Signed-off-by: Jianpeng Ma --- src/osd/ReplicatedPG.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index d1f348e84bc5..ce65cbd1c1c5 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3896,9 +3896,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) << " bytes from obj " << soid << dendl; // whole object? can we verify the checksum? - if (result >= 0 && - op.extent.offset == 0 && op.extent.length == oi.size && - oi.is_data_digest()) { + if (op.extent.length == oi.size && oi.is_data_digest()) { uint32_t crc = osd_op.outdata.crc32c(-1); if (oi.data_digest != crc) { osd->clog->error() << info.pgid << std::hex -- 2.47.3