Adds the new autosave configuration option.

Checks the parity validity invariant after reading the content file.
This commit is contained in:
Andrea Mazzoleni 2012-03-13 23:59:59 +01:00
parent e927c8d905
commit 2a50ec747d
11 changed files with 209 additions and 28 deletions

View file

@ -37,7 +37,9 @@ block_off_t parity_resize(struct snapraid_state* state)
/* start from the declared size */
block_off_t block = tommy_array_size(&disk->blockarr);
/* decrease the block until an allocated or deleted block */
/* decrease the block until an allocated one */
/* we don't stop at deleted blocks, because we want to have them cleared */
/* if they are at the end of the parity */
while (block > parity_block && !block_is_valid(tommy_array_get(&disk->blockarr, block - 1)))
--block;