Uses the deleted block offset when reading the text content to enlarge the parity size.

This ensures a better consistency check on the size of parity.
This commit is contained in:
Andrea Mazzoleni 2013-08-23 23:02:03 +02:00
parent d141c7bc13
commit e4fe228cc1
2 changed files with 4 additions and 6 deletions

2
TODO
View file

@ -3,8 +3,6 @@ SnapRAID TODO
This is the list of TODO items for SnapRAID.
* Check blockmax in hole ? RISKY ??
- v4.x
* If a content file is missing, sync should rewrite it, even if no change was done at the content.

View file

@ -1091,12 +1091,12 @@ static void state_read_text(struct snapraid_state* state, const char* path, STRE
exit(EXIT_FAILURE);
}
/* note that here we don't have a valid blockmax because we have not */
/* yet processed all the disks with all the files */
/* and then we cannot ensure that v_pos < blockmax */
deleted->block.parity_pos = v_pos;
/* keep track of the max block number used in parity */
if (v_pos + 1 > blockmax)
blockmax = v_pos + 1;
/* read the hash */
c = sgetc(f);
if (c != ' ') {