Re: [PATCH 3/5] ocfs2: Add missing annotation for dlm_empty_lockres()

From: Andrew Morton
Date: Wed Apr 15 2020 - 23:02:07 EST


On Sat, 4 Apr 2020 07:45:49 +0800 Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx> wrote:

> On 2020/4/4 00:05, Jules Irenge wrote:
> > Sparse reports a warning at dlm_empty_lockres()
> >
> > warning: context imbalance in dlm_purge_lockres() - unexpected unlock
> >
> > The root cause is the missing annotation at dlm_purge_lockres()
> >
> > Add the missing __must_hold(&dlm->spinlock)
> >
> Seems this is duplicate with assert_spin_locked()?

I doubt is sparse is smart enough to treat assert_spin_locked() as
equivalent to __must_hold(). It would be neat though.