From: Jianpeng Ma Date: Fri, 24 Jul 2015 05:39:10 +0000 (+0800) Subject: osd/ReplicatedPG:Optimize judgement when calc crc for read whole object. X-Git-Tag: v9.1.0~72^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8bfbcf6944ed48a0f5b9d665947ebf10b4191e33;p=ceph.git 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 --- 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