From owner-svn-src-projects@FreeBSD.ORG Wed Jan 26 23:35:44 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F218106566C; Wed, 26 Jan 2011 23:35:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2FE8FC0A; Wed, 26 Jan 2011 23:35:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p0QNVGwK064521; Wed, 26 Jan 2011 16:31:16 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D40AEC4.4070607@bsdimp.com> Date: Wed, 26 Jan 2011 16:31:16 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Thunderbird/3.1.7 MIME-Version: 1.0 To: John Baldwin References: <201101262034.p0QKYGkB089319@svn.freebsd.org> <201101261654.51397.jhb@freebsd.org> In-Reply-To: <201101261654.51397.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217907 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 23:35:44 -0000 On 01/26/2011 14:54, John Baldwin wrote: > On Wednesday, January 26, 2011 3:34:16 pm Warner Losh wrote: >> Author: imp >> Date: Wed Jan 26 20:34:16 2011 >> New Revision: 217907 >> URL: http://svn.freebsd.org/changeset/base/217907 >> >> Log: >> Set arg before timeout function pointer to avoid a 1 instruction race. >> >> Modified: >> projects/graid/head/sys/geom/raid/tr_raid1.c >> >> Modified: projects/graid/head/sys/geom/raid/tr_raid1.c >> > ============================================================================== >> --- projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 20:29:28 2011 > (r217906)+++ projects/graid/head/sys/geom/raid/tr_raid1.c Wed Jan 26 20:34:16 2011 > (r217907) >> @@ -259,8 +259,8 @@ g_raid_tr_update_state_raid1(struct g_ra >> G_RAID_EVENT_VOLUME); >> if (s == G_RAID_VOLUME_S_DEGRADED) { >> g_raid_tr_raid1_rebuild_start(vol->v_tr, vol); >> - vol->v_timeout = g_raid_tr_raid1_idle_rebuild; >> vol->v_to_arg = trs; >> + vol->v_timeout = g_raid_tr_raid1_idle_rebuild; >> } else { >> vol->v_timeout = 0; >> vol->v_to_arg = 0; > Err, this can't solve anything without a memory barrier given the ability of > modern CPUs on at least some architectures to reorder writes True. I thought this was the cause of a crash, but it turns out it was elsewhere. I'm reworking this, but thanks for the info. Warner