Commit 8f745e62 authored by Jules Irenge's avatar Jules Irenge Committed by Linus Torvalds

ocfs2: add missing annotation for dlm_empty_lockres()

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)
Signed-off-by: default avatarJules Irenge <jbi.octave@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Link: http://lkml.kernel.org/r/20200403160505.2832-4-jbi.octave@gmail.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 93e72b3c
...@@ -2760,6 +2760,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm, ...@@ -2760,6 +2760,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
* Returns: 1 if dlm->spinlock was dropped/retaken, 0 if never dropped * Returns: 1 if dlm->spinlock was dropped/retaken, 0 if never dropped
*/ */
int dlm_empty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) int dlm_empty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
__must_hold(&dlm->spinlock)
{ {
int ret; int ret;
int lock_dropped = 0; int lock_dropped = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment