Re: [PATCH] ocfs2: dlmfs: Hold l_lock through the unlock wakeup

From: Cen Zhang

Date: Wed Oct 14 2026 - 22:23:32 EST


Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx> 于2026年10月15日周四 09:09写道:
>
>
> cbe0e331fdbd only swaps ocfs2_cluster_connect() ->
> ocfs2_cluster_connect_agnostic() inside user_dlm_register(), but never
> touchs user_unlock_ast(). It seems it has existed since user_unlock_ast()
> was introduced in 8df08c89c668.
>
> The code change looks good. So after the above comments addressed, feel
> free to add:
>
> Reviewed-by: Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx>
>
> > Cc: <stable@xxxxxxxxxxxxxxx>
> > Signed-off-by: Cen Zhang <zzzccc427@xxxxxxxxx>
> > Assisted-by: LLM
> >
> > ---
> > diff --git a/fs/ocfs2/dlmfs/userdlm.c b/fs/ocfs2/dlmfs/userdlm.c
> > index 617c92e7b925..60653db7b411 100644
> > --- a/fs/ocfs2/dlmfs/userdlm.c
> > +++ b/fs/ocfs2/dlmfs/userdlm.c
> > @@ -253,9 +253,9 @@ static void user_unlock_ast(struct ocfs2_dlm_lksb *lksb, int status)
> >
> > lockres->l_flags &= ~USER_LOCK_BUSY;
> > out_noclear:
> > - spin_unlock(&lockres->l_lock);
> > -
> > + /* Complete the wakeup before a BUSY waiter can free lockres. */
> > wake_up(&lockres->l_event);
> > + spin_unlock(&lockres->l_lock);
> > }
> >
> > /*
>

Hi Joseph,

Thank you for the review. I will fix that.

Best regards,
Cen Zhang