Disallow elastic parity split reallocation during fix to preserve persisted layout

This commit is contained in:
Andrea Mazzoleni 2026-08-28 22:43:51 +02:00
parent f6d07dfa10
commit f8319361a3
5 changed files with 38 additions and 9 deletions

View file

@ -2040,11 +2040,10 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
int is_modified;
/*
* Change the size of the parity file, truncating or extending it
* from this point all the DELETED blocks after the end of the parity are invalid
* and they are automatically removed when we save the new content file
* Sync may reallocate an elastic split into following splits. Any resulting
* logical split mapping is persisted by the sync state-update protocol.
*/
ret = parity_chsize(&parity_handle[l], &state->parity[l], &is_modified, size, state->block_size, state->opt.skip_fallocate, state->opt.skip_space_holder);
ret = parity_chsize(&parity_handle[l], &state->parity[l], &is_modified, size, state->block_size, state->opt.skip_fallocate, state->opt.skip_space_holder, 1);
if (ret == -1) {
/* LCOV_EXCL_START */
data_off_t out_size;