]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedBackend: check against empty data_included before enabling crc 29621/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 13 Aug 2019 02:03:27 +0000 (10:03 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 13 Aug 2019 02:03:27 +0000 (10:03 +0800)
The data_included portion could be empty, e.g., due to there are
too many omap entries and can not be sent in one shot, which as
a result may end up crashing the OSD.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/ReplicatedBackend.cc

index ab47934026d183e247962fd9d8b4439823253d19..6e9c7ce26758ba75a742329e94ec7734af28c600 100644 (file)
@@ -2117,7 +2117,8 @@ int ReplicatedBackend::build_push_op(const ObjectRecoveryInfo &recovery_info,
     }
     out_op->data.claim_append(bit);
   }
-  if (progress.first && out_op->data_included.begin().get_start() == 0 &&
+  if (progress.first && !out_op->data_included.empty() &&
+      out_op->data_included.begin().get_start() == 0 &&
       out_op->data.length() == oi.size && oi.is_data_digest()) {
     uint32_t crc = out_op->data.crc32c(-1);
     if (oi.data_digest != crc) {