From: xie xingguo Date: Tue, 13 Aug 2019 02:03:27 +0000 (+0800) Subject: osd/ReplicatedBackend: check against empty data_included before enabling crc X-Git-Tag: v15.1.0~1865^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5958600157c5fa8266b82cd4d448ec2c19f3f062;p=ceph.git osd/ReplicatedBackend: check against empty data_included before enabling crc 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 --- diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index ab47934026d..6e9c7ce2675 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -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) {