ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH 3/5] ocfs2: Add missing annotation for dlm_empty_lockres()
       [not found] ` <20200403160505.2832-1-jbi.octave@gmail.com>
@ 2020-04-03 16:05   ` Jules Irenge
  2020-04-03 23:45     ` Joseph Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Jules Irenge @ 2020-04-03 16:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Mark Fasheh, Joel Becker, Joseph Qi, Andrew Morton,
	Gang He, Richard Fontana, Allison Randal, Thomas Gleixner,
	Aditya Pakki, ChenGang, Masahiro Yamada,
	moderated list:ORACLE CLUSTER FILESYSTEM 2 OCFS2

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: Jules Irenge <jbi.octave@gmail.com>
---
 fs/ocfs2/dlm/dlmmaster.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 900f7e466d11..8cbd46b3509a 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -2762,6 +2762,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
  * 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)
+	__must_hold(&dlm->spinlock)
 {
 	int ret;
 	int lock_dropped = 0;
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH 3/5] ocfs2: Add missing annotation for dlm_empty_lockres()
  2020-04-03 16:05   ` [Ocfs2-devel] [PATCH 3/5] ocfs2: Add missing annotation for dlm_empty_lockres() Jules Irenge
@ 2020-04-03 23:45     ` Joseph Qi
  2020-04-16  3:02       ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph Qi @ 2020-04-03 23:45 UTC (permalink / raw)
  To: Jules Irenge, linux-kernel
  Cc: boqun.feng, Mark Fasheh, Joel Becker, Andrew Morton, Gang He,
	Richard Fontana, Allison Randal, Thomas Gleixner, Aditya Pakki,
	ChenGang, Masahiro Yamada,
	moderated list:ORACLE CLUSTER FILESYSTEM 2 (OCFS2)



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()?

Thanks,
Joseph

> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
> ---
>  fs/ocfs2/dlm/dlmmaster.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index 900f7e466d11..8cbd46b3509a 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -2762,6 +2762,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
>   * 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)
> +	__must_hold(&dlm->spinlock)
>  {
>  	int ret;
>  	int lock_dropped = 0;
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH 3/5] ocfs2: Add missing annotation for dlm_empty_lockres()
  2020-04-03 23:45     ` Joseph Qi
@ 2020-04-16  3:02       ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2020-04-16  3:02 UTC (permalink / raw)
  To: Joseph Qi
  Cc: Jules Irenge, linux-kernel, boqun.feng, Mark Fasheh, Joel Becker,
	Gang He, Richard Fontana, Allison Randal, Thomas Gleixner,
	Aditya Pakki, ChenGang, Masahiro Yamada,
	moderated list:ORACLE CLUSTER FILESYSTEM 2 (OCFS2)

On Sat, 4 Apr 2020 07:45:49 +0800 Joseph Qi <joseph.qi@linux.alibaba.com> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-16  3:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <0/5>
     [not found] ` <20200403160505.2832-1-jbi.octave@gmail.com>
2020-04-03 16:05   ` [Ocfs2-devel] [PATCH 3/5] ocfs2: Add missing annotation for dlm_empty_lockres() Jules Irenge
2020-04-03 23:45     ` Joseph Qi
2020-04-16  3:02       ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).