In sync message if the parity is invalid

This commit is contained in:
Andrea Mazzoleni 2026-02-01 23:12:38 +01:00
parent d3f7bf64c1
commit 3732800a0b

View file

@ -2009,18 +2009,23 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
no_difference = !total.count_move && !total.count_copy && !total.count_restore no_difference = !total.count_move && !total.count_copy && !total.count_restore
&& !total.count_change && !total.count_remove && !total.count_insert; && !total.count_change && !total.count_remove && !total.count_insert;
int parity_invalid = parity_is_invalid(state);
if (is_diff) { if (is_diff) {
if (no_difference) { if (!no_difference) {
msg_status("No differences\n");
} else {
msg_status("There are differences!\n"); msg_status("There are differences!\n");
} else {
msg_status("No differences\n");
} }
if (parity_invalid)
log_error(EUSER, "The last sync was interrupted. Run it again!\n");
} }
if (no_difference) { if (parity_invalid) {
log_tag("summary:exit:equal\n"); log_tag("summary:exit:incomplete_sync\n");
} else { } else if (!no_difference) {
log_tag("summary:exit:diff\n"); log_tag("summary:exit:diff\n");
} else {
log_tag("summary:exit:equal\n");
} }
log_flush(); log_flush();
@ -2035,7 +2040,7 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
return 1; return 1;
/* check also for incomplete "sync" */ /* check also for incomplete "sync" */
if (parity_is_invalid(state)) if (parity_invalid)
return 1; return 1;
} }