[Cluster-devel] [GFS2 PATCH] Handle multiple glock demote requests

Wendy Cheng wcheng at redhat.com
Thu Oct 4 21:48:53 UTC 2007


Josef Bacik wrote:
>>  	set_bit(GLF_LOCK, &gl->gl_flags);
>> +	set_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags);
>>  	if (gl->gl_demote_state == LM_ST_UNLOCKED ||
>>  	    gl->gl_state != LM_ST_EXCLUSIVE) {
>>  		spin_unlock(&gl->gl_spin);
>> @@ -575,6 +576,8 @@ static int rq_demote(struct gfs2_glock *
>>  		spin_unlock(&gl->gl_spin);
>>  		gfs2_glock_xmote_th(gl, NULL);
>>  	}
>> +
>> +	clear_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags);
>>  	spin_lock(&gl->gl_spin);
>>
>>     
>
> May want to move the clear_bit inside the spin_lock so you don't end up having
> the same race where we clear the bit while inside handle_callback.
>
>   
Yep... good point .... Will make changes .. Wendy




More information about the Cluster-devel mailing list