Make snapraid_io track started state and defer async I/O after initial thermal control

This commit is contained in:
Andrea Mazzoleni 2026-09-07 10:15:13 +02:00
parent 595461f725
commit 74647cda14
6 changed files with 39 additions and 16 deletions

View file

@ -345,7 +345,7 @@ void state_thermal_cooldown(struct snapraid_state* state)
int sleep_time = cooldown_time;
log_tag("thermal:spindown\n");
/*
* Power management is best effort.
*
@ -417,11 +417,8 @@ int state_thermal_begin(struct snapraid_state* state, time_t now)
}
if (state_thermal_alarm(state)) {
/* LCOV_EXCL_START */
log_fatal(EENVIRONMENT, "DANGER! Hard disk temperature of %d degrees is already outside the operating range. Unable to proceed!\n", state->thermal_highest_temperature);
log_flush();
return 0;
/* LCOV_EXCL_STOP */
msg_progress("Hard disk temperature of %d degrees is already outside the operating range. Cooling down before starting...\n", state->thermal_highest_temperature);
state_thermal_cooldown(state);
}
return 1;