summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/primary.c
diff options
context:
space:
mode:
authortrociny <trociny@FreeBSD.org>2011-06-28 21:01:32 +0000
committertrociny <trociny@FreeBSD.org>2011-06-28 21:01:32 +0000
commit82faa3e64109fa8b1a1833758bd1404e494548b2 (patch)
tree5c9bb28d9bd65942c34ab61693db25350b28c209 /sbin/hastd/primary.c
parent55657cdc996887b1bcc18c7890cd4916a682e76e (diff)
downloadFreeBSD-src-82faa3e64109fa8b1a1833758bd1404e494548b2.zip
FreeBSD-src-82faa3e64109fa8b1a1833758bd1404e494548b2.tar.gz
Check the returned value of activemap_write_complete() and update matadata on
disk if needed. This should fix a potential case when extents are cleared in activemap but metadata is not updated on disk. Suggested by: pjd Approved by: pjd (mentor)
Diffstat (limited to 'sbin/hastd/primary.c')
-rw-r--r--sbin/hastd/primary.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c
index af0f353..e1f2ba4 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) {
OpenPOWER on IntegriCloud