mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-03 13:20:28 -05:00
Handles a corner case when clearing hash when loading the content file.
This commit is contained in:
parent
066709370e
commit
edb97c21d7
1 changed files with 13 additions and 4 deletions
17
state.c
17
state.c
|
|
@ -879,6 +879,11 @@ static void state_content_check(struct snapraid_state* state, const char* path)
|
||||||
* Checks if a block position is used by at least one disk
|
* Checks if a block position is used by at least one disk
|
||||||
* and has a hash value.
|
* and has a hash value.
|
||||||
* Note that we include DELETED blocks, but only if they have a not NULL hash.
|
* Note that we include DELETED blocks, but only if they have a not NULL hash.
|
||||||
|
*
|
||||||
|
* This is needed to know if for such block we have to keep the "rehash" info
|
||||||
|
* or if we can drop it.
|
||||||
|
* Note that even if the block is not used by any file, the presence of a
|
||||||
|
* DELETE block with hash, will maintain the info.
|
||||||
*/
|
*/
|
||||||
static int position_has_any_hash(struct snapraid_state* state, block_off_t pos)
|
static int position_has_any_hash(struct snapraid_state* state, block_off_t pos)
|
||||||
{
|
{
|
||||||
|
|
@ -2393,10 +2398,14 @@ static void state_read_binary(struct snapraid_state* state, const char* path, ST
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (info) {
|
/* if we are clearing hashes, it's possible that */
|
||||||
decoding_error(path, f);
|
/* we have info even if no hash is present */
|
||||||
fprintf(stderr, "Internal inconsistency for unexpected info!\n");
|
if (!state->clear_undeterminate_hash) {
|
||||||
exit(EXIT_FAILURE);
|
if (info) {
|
||||||
|
decoding_error(path, f);
|
||||||
|
fprintf(stderr, "Internal inconsistency for unexpected info!\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue