Disable some operations affected by hash collision

This only if we are working with a reduced hash length.
This commit is contained in:
Andrea Mazzoleni 2016-04-10 19:13:08 +02:00
parent ab7d4e896c
commit 5bf030c793
4 changed files with 31 additions and 5 deletions

View file

@ -982,8 +982,8 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
/* have "parity_needs_to_be_updated" already at 1 */
assert(block_state_get(block) == BLOCK_STATE_CHG);
/* if there is an hash */
if (hash_is_real(block->hash)) {
/* if the hash represents the data uniquievocally */
if (hash_is_unique(block->hash)) {
/* check if the hash is changed */
if (memcmp(hash, block->hash, BLOCK_HASH_SIZE) != 0) {
/* the block is different, and we must update parity */