Defer pending snapshot promotion until parity sync

This commit is contained in:
Andrea Mazzoleni 2026-08-12 14:53:58 +02:00
parent 554adc9048
commit 6cab8e3909
48 changed files with 352 additions and 145 deletions

View file

@ -1691,8 +1691,13 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
exit(EXIT_SUCCESS);
}
/* skip degenerated cases of empty parity, or skipping all */
if (blockstart < blockmax) {
/* make the scanned state available for recovery before changing parity */
if (state_snapshot_pending(state) != 0) {
/* LCOV_EXCL_START */
++process_error;
/* continue, as we are already exiting */
/* LCOV_EXCL_STOP */
} else if (blockstart < blockmax) {
ret = state_sync_process(state, parity_handle, blockstart, blockmax);
if (ret == -1) {
/* LCOV_EXCL_START */