]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG:Optimize judgement when calc crc for read whole object.
authorJianpeng Ma <jianpeng.ma@intel.com>
Fri, 24 Jul 2015 05:39:10 +0000 (13:39 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Fri, 18 Sep 2015 06:44:50 +0000 (14:44 +0800)
If extent.length == oi.size, this mean read success and read the whole
object. No need other conditions.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/osd/ReplicatedPG.cc

index d1f348e84bc5ee80bf69fff9f08d71aa1c4cc313..ce65cbd1c1c516a98e61a244ffbe5c64defc5a9e 100644 (file)
@@ -3896,9 +3896,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& 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