There's no need to hold the lock, the SLURM loading action doesn't modify the current DB state; it's altering the new DB state, which will be utilized later to replace the current DB state (and that's where the lock is needed).
if (error)
return error;
- rwlock_write_lock(&state_lock);
-
error = slurm_apply(&new_base, &state.slurm);
if (error) {
rwlock_unlock(&state_lock);
goto revert_base;
}
+ rwlock_write_lock(&state_lock);
+
if (state.base != NULL) {
error = compute_deltas(state.base, new_base, &deltas);
if (error) {