Unified the two --force-realloc logics

This commit is contained in:
Andrea Mazzoleni 2026-02-09 11:46:38 +01:00
parent 966583e6f0
commit f89d5fa4f3
3 changed files with 25 additions and 18 deletions

View file

@ -2232,15 +2232,6 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
block_state_set(block, BLOCK_STATE_CHG);
}
/* if we want a full reallocation, marks block as invalid parity */
/* note that we do this after the force_nocopy option */
/* to avoid to mixup the two things */
if (state->opt.force_realloc && state->opt.parity_tail == 0
&& block_state_get(block) == BLOCK_STATE_BLK) {
/* convert from BLK to REP */
block_state_set(block, BLOCK_STATE_REP);
}
/* set the parity association */
fs_allocate(disk, v_pos, file, v_idx);