From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wendy Cheng Date: Thu, 04 Oct 2007 17:48:53 -0400 Subject: [Cluster-devel] [GFS2 PATCH] Handle multiple glock demote requests In-Reply-To: <20071004213445.GA23201@dhcp243-37.rdu.redhat.com> References: <47052B29.2010604@redhat.com> <20071004213445.GA23201@dhcp243-37.rdu.redhat.com> Message-ID: <47055FC5.9040706@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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