From owner-svn-src-stable@FreeBSD.ORG Thu Oct 31 20:30:27 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 844EA209; Thu, 31 Oct 2013 20:30:27 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 70FB5200E; Thu, 31 Oct 2013 20:30:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VKURuj047823; Thu, 31 Oct 2013 20:30:27 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VKURdB047822; Thu, 31 Oct 2013 20:30:27 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310312030.r9VKURdB047822@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 31 Oct 2013 20:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257468 - stable/10/sbin/hastd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Oct 2013 20:30:27 -0000 Author: trociny Date: Thu Oct 31 20:30:26 2013 New Revision: 257468 URL: http://svnweb.freebsd.org/changeset/base/257468 Log: MFC r257154: 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. Approved by: re (glebius) Modified: stable/10/sbin/hastd/primary.c Directory Properties: stable/10/sbin/hastd/ (props changed) Modified: stable/10/sbin/hastd/primary.c ============================================================================== --- stable/10/sbin/hastd/primary.c Thu Oct 31 20:12:37 2013 (r257467) +++ stable/10/sbin/hastd/primary.c Thu Oct 31 20:30:26 2013 (r257468) @@ -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);