Assumes also CHG blocks with a NULL hash without needing an info block.

Some refactoring and renaming of other hash functions to avoid misunderstanding.
This commit is contained in:
Andrea Mazzoleni 2013-08-21 22:24:12 +02:00
parent 9ad388724e
commit e0afd0edf7
6 changed files with 50 additions and 34 deletions

View file

@ -266,7 +266,7 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par
memhash(state->hash, state->hashseed, hash, buffer[j], read_size);
}
if (block_has_hash(block)) {
if (block_has_updated_hash(block)) {
/* compare the hash */
if (memcmp(hash, block->hash, HASH_SIZE) != 0) {
fprintf(stdlog, "error:%u:%s:%s: Data error at position %u\n", i, handle[j].disk->name, block_file_get(block)->sub, block_file_pos(block));