Fixes some comments.

This commit is contained in:
Andrea Mazzoleni 2013-08-21 22:04:10 +02:00
parent 4921ff6f80
commit 9ad388724e
2 changed files with 6 additions and 4 deletions

View file

@ -364,9 +364,9 @@ static int repair(struct snapraid_state* state, int rehash, unsigned pos, unsign
/* If the block is CHG or DELETED, we don't have the original content of block, */
/* and we must try to recover it. */
/* This apply to CHG blocks even if they are not marked bad, */
/* because the parityis computed with old content, and not with the new one. */
/* because the parity is computed with old content, and not with the new one. */
/* Note that this recovering is done just to make possible to recover any other BLK one, */
/* we are not really interseted in DELETED and CHG (old version) ones. */
/* we are not really interested in DELETED and CHG (old version) ones. */
/* try to fetch the old block using the old hash */
if (state_import_fetch(state, rehash, failed[j].block->hash, buffer[failed[j].index]) == 0) {

6
elem.h
View file

@ -100,10 +100,12 @@ struct snapraid_filter {
* This block is a deleted one.
* This happens when a file is deleted.
*
* The block hash field IS set, and it represents the hash of the previous data.
* The block hash field IS set, and it represents the hash of the previous data, but only
* if it's different by all 0.
* The parity for this disk is not updated, but it contains the old data referenced by the hash.
*
* If the hash is completely filled with 0, it means that its lost.
* If the hash is completely filled with 0, it means that the hash is lost.
* This could happen if a NEW block is deleted in an interrupted sync.
*/
#define BLOCK_STATE_DELETED 4