Abort saving content file if rehash blocks exist with undefined previous checksum

This commit is contained in:
Andrea Mazzoleni 2026-07-13 11:02:33 +02:00
parent a144fdc721
commit 1093ba9bbb

View file

@ -3909,6 +3909,13 @@ static void state_write_content(struct snapraid_state* state, uint32_t* out_crc)
}
}
if (info_has_rehash && state->prevhash == HASH_UNDEFINED) {
/* LCOV_EXCL_START */
log_fatal(EINTERNAL, "Internal inconsistency: Rehash blocks found but previous checksum is missing!\n");
os_abort();
/* LCOV_EXCL_STOP */
}
/* map disks */
mapping_idx = 0;
for (i = state->maplist; i != 0; i = i->next) {