);
}
+void TransactionManager::check_full_extent_integrity(
+ Transaction &t, uint32_t ref_crc, uint32_t pin_crc)
+{
+ LOG_PREFIX(TransactionManager::check_full_extent_integrity);
+ SUBDEBUGT(seastore_tm,
+ "checksum in the lba tree: 0x{:x}, actual checksum: 0x{:x}",
+ 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)) {
+ SUBERRORT(seastore_tm,
+ "extent checksum inconsistent, recorded: 0x{:x}, actual: 0x{:x}",
+ t,
+ pin_crc,
+ ref_crc);
+ ceph_abort_msg("extent checksum inconsistent");
+ }
+}
+
seastar::future<> TransactionManager::flush(OrderingHandle &handle)
{
LOG_PREFIX(TransactionManager::flush);
}
).si_then([FNAME, &t, pin=pin, this](auto ref) mutable -> ret {
if (ref->is_fully_loaded()) {
- auto crc = ref->calc_crc32c();
- SUBTRACET(
- seastore_tm,
- "got extent -- {}, chksum in the lba tree: 0x{:x}, actual chksum: 0x{:x}",
- t,
- *ref,
- pin.get_checksum(),
- crc);
- bool inconsistent = false;
- if (full_extent_integrity_check) {
- inconsistent = (pin.get_checksum() != crc);
- } else { // !full_extent_integrity_check: remapped extent may be skipped
- inconsistent = !(pin.get_checksum() == 0 ||
- pin.get_checksum() == crc);
- }
- if (unlikely(inconsistent)) {
- SUBERRORT(seastore_tm,
- "extent checksum inconsistent, recorded: 0x{:x}, actual: 0x{:x}, {}",
- t,
- pin.get_checksum(),
- crc,
- *ref);
- ceph_abort();
- }
+ check_full_extent_integrity(t, ref->calc_crc32c(), pin.get_checksum());
} else {
assert(!full_extent_integrity_check);
}
});
}
+ void check_full_extent_integrity(
+ Transaction &t, uint32_t ref_crc, uint32_t pin_crc);
+
/**
* pin_to_extent_by_type
*
pin.get_checksum(),
crc);
assert(ref->is_fully_loaded());
- bool inconsistent = false;
- if (full_extent_integrity_check) {
- inconsistent = (pin.get_checksum() != crc);
- } else { // !full_extent_integrity_check: remapped extent may be skipped
- inconsistent = !(pin.get_checksum() == 0 ||
- pin.get_checksum() == crc);
- }
- if (unlikely(inconsistent)) {
- SUBERRORT(seastore_tm,
- "extent checksum inconsistent, recorded: 0x{:x}, actual: 0x{:x}, {}",
- t,
- pin.get_checksum(),
- crc,
- *ref);
- ceph_abort();
- }
+ check_full_extent_integrity(t, ref->calc_crc32c(), pin.get_checksum());
return pin_to_extent_by_type_ret(
interruptible::ready_future_marker{},
std::move(ref->template cast<LogicalChildNode>()));