diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c index af0f35375669..e1f2ba4d819b 100644 --- a/sbin/hastd/primary.c +++ b/sbin/hastd/primary.c @@ -1687,8 +1687,11 @@ ggate_send_thread(void *arg) } if (ggio->gctl_error == 0 && ggio->gctl_cmd == BIO_WRITE) { mtx_lock(&res->hr_amp_lock); - activemap_write_complete(res->hr_amp, - ggio->gctl_offset, ggio->gctl_length); + if (activemap_write_complete(res->hr_amp, + ggio->gctl_offset, ggio->gctl_length)) { + res->hr_stat_activemap_update++; + (void)hast_activemap_flush(res); + } mtx_unlock(&res->hr_amp_lock); } if (ggio->gctl_cmd == BIO_WRITE) {