It's node_write_config() itself that should unset the dirty flag, depending
on the storage policy and if storage succeeded. Otherwise, we risk that
setting the storage policy back to ENABLED after calling meshlink_stop()
will not cause pending updates to be written out by meshlink_close().
if(mesh->nodes) {
for splay_each(node_t, n, mesh->nodes) {
if(n->status.dirty) {
- n->status.dirty = !node_write_config(mesh, n, false);
+ if(!node_write_config(mesh, n, false)) {
+ // ignore
+ }
}
}
}