diff options
author | Mikolaj Golub <trociny@FreeBSD.org> | 2011-06-28 21:01:32 +0000 |
---|---|---|
committer | Mikolaj Golub <trociny@FreeBSD.org> | 2011-06-28 21:01:32 +0000 |
commit | d9f039e0b34b48097ecd277f0a90226ab9485360 (patch) | |
tree | 5c9bb28d9bd65942c34ab61693db25350b28c209 /sbin | |
parent | aa64b2f494de6d7c32c3316deea5ba3939592e49 (diff) | |
download | src-d9f039e0b34b48097ecd277f0a90226ab9485360.tar.gz src-d9f039e0b34b48097ecd277f0a90226ab9485360.zip |
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)
Notes
Notes:
svn path=/head/; revision=223655
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/hastd/primary.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) { |