svn commit: r217907 - projects/graid/head/sys/geom/raid

Warner Losh imp at bsdimp.com
Wed Jan 26 23:35:44 UTC 2011


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


More information about the svn-src-projects mailing list