Add regression tests and document parity size requirements when adding a parity level

This commit is contained in:
Andrea Mazzoleni 2026-09-08 10:06:11 +02:00
parent 6971bd58c9
commit e8726ce95a
2 changed files with 52 additions and 0 deletions

View file

@ -2031,6 +2031,11 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
* A full parity rebuild or reallocation from zero reconstructs truncated
* parity. Tail-only reallocation still relies on the existing prefix, so a
* truncation before parity_tail remains fatal.
*
* New levels need the same physical coverage of valid blocks, not an exact
* match with another level or the allocated extent. After an interrupted
* sync, fix leaves pending parity to sync and may truncate its unwritten
* tail. Sync will resize and regenerate that tail if it is still allocated.
*/
if (!state->opt.force_full && !(state->opt.force_realloc && state->opt.parity_tail == 0)) {
/* if the parities are too small */