mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Sets NEW hash to 0 when converting them to DELETED blocks.
This avoids to use not initialized hash for deleted blocks, when deleting files after an aborted sync.
This commit is contained in:
parent
7414f8daec
commit
18deae30a4
1 changed files with 4 additions and 1 deletions
5
scan.c
5
scan.c
|
|
@ -170,8 +170,11 @@ static void scan_file_remove(struct snapraid_state* state, struct snapraid_disk*
|
|||
case BLOCK_STATE_BLK :
|
||||
/* we keep the hash making it an "old" hash, because the parity is still containing data for it */
|
||||
break;
|
||||
case BLOCK_STATE_CHG :
|
||||
case BLOCK_STATE_NEW :
|
||||
/* NEW blocks don't have a hash, then we set it to the 'unspecified' 0 value */
|
||||
memset(block->hash, 0, HASH_SIZE);
|
||||
break;
|
||||
case BLOCK_STATE_CHG :
|
||||
/* if we have not already cleared the undeterminated hash */
|
||||
if (!state->clear_undeterminate_hash) {
|
||||
/* in these cases we don't know if the old state is still the one */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue