Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jan 2011 16:31:16 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        svn-src-projects@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r217907 - projects/graid/head/sys/geom/raid
Message-ID:  <4D40AEC4.4070607@bsdimp.com>
In-Reply-To: <201101261654.51397.jhb@freebsd.org>
References:  <201101262034.p0QKYGkB089319@svn.freebsd.org> <201101261654.51397.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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