Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Oct 2013 08:35:54 +0000 (UTC)
From:      Mikolaj Golub <trociny@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r257154 - head/sbin/hastd
Message-ID:  <201310260835.r9Q8Zs7I078532@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trociny
Date: Sat Oct 26 08:35:54 2013
New Revision: 257154
URL: http://svnweb.freebsd.org/changeset/base/257154

Log:
  Merging local and remote bitmaps must be protected by hr_amp lock.
  
  This is believed to fix hastd crashes, which might occur during
  synchronization, triggered by the failed assertion:
  
   Assertion failed: (amp->am_memtab[ext] > 0),
   function activemap_write_complete, file activemap.c, line 351.
  
  MFC after:	1 week

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==============================================================================
--- head/sbin/hastd/primary.c	Sat Oct 26 08:34:35 2013	(r257153)
+++ head/sbin/hastd/primary.c	Sat Oct 26 08:35:54 2013	(r257154)
@@ -781,6 +781,7 @@ init_remote(struct hast_resource *res, s
 			free(map);
 			goto close;
 		}
+		mtx_lock(&res->hr_amp_lock);
 		/*
 		 * Merge local and remote bitmaps.
 		 */
@@ -790,7 +791,6 @@ init_remote(struct hast_resource *res, s
 		 * Now that we merged bitmaps from both nodes, flush it to the
 		 * disk before we start to synchronize.
 		 */
-		mtx_lock(&res->hr_amp_lock);
 		(void)hast_activemap_flush(res);
 	}
 	nv_free(nvin);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310260835.r9Q8Zs7I078532>