val.pladdr = paddr + remap.offset;
}
val.refcount = EXTENT_DEFAULT_REF_COUNT;
- val.checksum = 0; // the checksum should be updated later when
- // committing the transaction
+ // Checksum will be updated when the committing the transaction
+ val.checksum = CRC_NULL;
return btree.insert(c, iter, new_key, std::move(val)
).si_then([c, &remap, &mapping, &ret, &iter](auto p) {
auto &[it, inserted] = p;
t,
pin_crc,
ref_crc);
- bool inconsistent = false;
- if (full_extent_integrity_check) {
- inconsistent = (pin_crc != ref_crc);
- } else { // !full_extent_integrity_check: remapped extent may be skipped
- inconsistent = !(pin_crc == 0 ||
- pin_crc == ref_crc);
- }
- if (unlikely(inconsistent)) {
+ if (unlikely(pin_crc != ref_crc)) {
SUBERRORT(seastore_tm,
"extent checksum inconsistent, recorded: 0x{:x}, actual: 0x{:x}",
t,
}
}).si_then([this, &t, &remaps, original_paddr,
original_laddr, original_len, FNAME](auto ext) mutable {
- ceph_assert(full_extent_integrity_check
- ? (ext && ext->is_fully_loaded())
- : true);
+ if (full_extent_integrity_check) {
+ ceph_assert(ext && ext->is_fully_loaded());
+ // CRC_NULL shouldn't be possible when full extent
+ // integrity checks are enabled.
+ assert(ext->calc_crc32c() != CRC_NULL);
+ }
std::optional<ceph::bufferptr> original_bptr;
// TODO: preserve the bufferspace if partially loaded
if (ext && ext->is_fully_loaded()) {
});
}
- void check_full_extent_integrity(
+ static void check_full_extent_integrity(
Transaction &t, uint32_t ref_crc, uint32_t pin_crc);
/**