Persist content state after parity handles are closed in scrub

This commit is contained in:
Andrea Mazzoleni 2026-09-04 08:20:04 +02:00
parent 930f0dbbcb
commit 719bc5a3d5

View file

@ -958,10 +958,6 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par
end:
state_progress_end(state, countpos, countmax, countsize, "Nothing to scrub. Use the -p PLAN option to select a different plan, like -p full.\n");
/* save the new state if required */
if (state->need_write || state->opt.force_content_write)
state_write(state);
state_usage_print(state);
if (soft_error || silent_error || io_error) {
@ -1241,6 +1237,10 @@ int state_scrub(struct snapraid_state* state, int plan100, int olderthan)
}
}
/* persist progress and error markings only after all parity handles are closed */
if (state->need_write || state->opt.force_content_write)
state_write(state);
if (process_error != 0)
return -1;