mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 02:49:02 -04:00
Adds a consistency check about missing previous hash.
This commit is contained in:
parent
0db2428132
commit
865fc0c1f4
1 changed files with 6 additions and 1 deletions
7
state.c
7
state.c
|
|
@ -1074,6 +1074,11 @@ void state_read(struct snapraid_state* state)
|
|||
} else if (strcmp(buffer, "rehash") == 0) {
|
||||
rehash = 1;
|
||||
hash = oathash8(hash, 'y');
|
||||
|
||||
if (state->prevhash == HASH_UNDEFINED) {
|
||||
fprintf(stderr, "Internal incosistency for missing previous checksum in '%s' at line %u\n", path, line);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "Invalid 'inf' specification '%s' in '%s' at line %u\n", buffer, path, line);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
@ -1701,7 +1706,7 @@ void state_read(struct snapraid_state* state)
|
|||
if (state->hash == HASH_UNDEFINED) {
|
||||
fprintf(stderr, "The checksum to use is not specified.\n");
|
||||
fprintf(stderr, "This happens because you are likely upgrading from SnapRAID 1.0.\n");
|
||||
fprintf(stderr, "To use the SnapRAID 2.x branch, you must restart from scratch,\n");
|
||||
fprintf(stderr, "To use a new SnapRAID you must restart from scratch,\n");
|
||||
fprintf(stderr, "deleting all the content and parity files.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue