Author: trociny
Date: Tue Jun 28 21:01:32 2011
New Revision: 223655
URL: http://svn.freebsd.org/changeset/base/223655

Log:
  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)

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==============================================================================
--- head/sbin/hastd/primary.c   Tue Jun 28 20:57:54 2011        (r223654)
+++ head/sbin/hastd/primary.c   Tue Jun 28 21:01:32 2011        (r223655)
@@ -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) {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to