All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ocfs2: Add missing annotations for ocfs2_refcount_cache_lock() and ocfs2_refcount_cache_unlock()
@ 2020-02-24 20:41 ` Jules Irenge
  0 siblings, 0 replies; 4+ messages in thread
From: Jules Irenge @ 2020-02-24 20:41 UTC (permalink / raw)
  To: boqun.feng
  Cc: joseph.qi, Jules Irenge, Mark Fasheh, Joel Becker, Joseph Qi,
	moderated list:ORACLE CLUSTER FILESYSTEM 2 (OCFS2),
	open list

Sparse reports warnings at ocfs2_refcount_cache_lock()
	and ocfs2_refcount_cache_unlock()

warning: context imbalance in ocfs2_refcount_cache_lock()
	- wrong count at exit
warning: context imbalance in ocfs2_refcount_cache_unlock()
	- unexpected unlock

The root cause is the missing annotation at ocfs2_refcount_cache_lock()
	and at ocfs2_refcount_cache_unlock()

Add the missing __acquires(&rf->rf_lock) annotation
	to ocfs2_refcount_cache_lock()
Add the missing __releases(&rf->rf_lock) annotation
	to ocfs2_refcount_cache_unlock()

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 fs/ocfs2/refcounttree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index ee43e51188be..da99c80f49da 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -154,6 +154,7 @@ ocfs2_refcount_cache_get_super(struct ocfs2_caching_info *ci)
 }
 
 static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci)
+	__acquires(&rf->rf_lock)
 {
 	struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci);
 
@@ -161,6 +162,7 @@ static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci)
 }
 
 static void ocfs2_refcount_cache_unlock(struct ocfs2_caching_info *ci)
+	__releases(&rf->rf_lock)
 {
 	struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci);
 
-- 
2.24.1


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

* [Ocfs2-devel] [PATCH] ocfs2: Add missing annotations for ocfs2_refcount_cache_lock() and ocfs2_refcount_cache_unlock()
@ 2020-02-24 20:41 ` Jules Irenge
  0 siblings, 0 replies; 4+ messages in thread
From: Jules Irenge @ 2020-02-24 20:41 UTC (permalink / raw)
  To: boqun.feng
  Cc: joseph.qi, Jules Irenge, Mark Fasheh, Joel Becker, Joseph Qi,
	moderated list:ORACLE CLUSTER FILESYSTEM 2 OCFS2, open list

Sparse reports warnings at ocfs2_refcount_cache_lock()
	and ocfs2_refcount_cache_unlock()

warning: context imbalance in ocfs2_refcount_cache_lock()
	- wrong count at exit
warning: context imbalance in ocfs2_refcount_cache_unlock()
	- unexpected unlock

The root cause is the missing annotation at ocfs2_refcount_cache_lock()
	and at ocfs2_refcount_cache_unlock()

Add the missing __acquires(&rf->rf_lock) annotation
	to ocfs2_refcount_cache_lock()
Add the missing __releases(&rf->rf_lock) annotation
	to ocfs2_refcount_cache_unlock()

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 fs/ocfs2/refcounttree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index ee43e51188be..da99c80f49da 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -154,6 +154,7 @@ ocfs2_refcount_cache_get_super(struct ocfs2_caching_info *ci)
 }
 
 static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci)
+	__acquires(&rf->rf_lock)
 {
 	struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci);
 
@@ -161,6 +162,7 @@ static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci)
 }
 
 static void ocfs2_refcount_cache_unlock(struct ocfs2_caching_info *ci)
+	__releases(&rf->rf_lock)
 {
 	struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci);
 
-- 
2.24.1

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

* Re: [PATCH] ocfs2: Add missing annotations for ocfs2_refcount_cache_lock() and ocfs2_refcount_cache_unlock()
  2020-02-24 20:41 ` [Ocfs2-devel] " Jules Irenge
@ 2020-02-25  0:53   ` Joseph Qi
  -1 siblings, 0 replies; 4+ messages in thread
From: Joseph Qi @ 2020-02-25  0:53 UTC (permalink / raw)
  To: Jules Irenge, boqun.feng
  Cc: joseph.qi, Mark Fasheh, Joel Becker,
	moderated list:ORACLE CLUSTER FILESYSTEM 2 (OCFS2),
	open list, Andrew Morton



On 2020/2/25 04:41, Jules Irenge wrote:
> Sparse reports warnings at ocfs2_refcount_cache_lock()
> 	and ocfs2_refcount_cache_unlock()
> 
> warning: context imbalance in ocfs2_refcount_cache_lock()
> 	- wrong count at exit
> warning: context imbalance in ocfs2_refcount_cache_unlock()
> 	- unexpected unlock
> 
> The root cause is the missing annotation at ocfs2_refcount_cache_lock()
> 	and at ocfs2_refcount_cache_unlock()
> 
> Add the missing __acquires(&rf->rf_lock) annotation
> 	to ocfs2_refcount_cache_lock()
> Add the missing __releases(&rf->rf_lock) annotation
> 	to ocfs2_refcount_cache_unlock()
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
>  fs/ocfs2/refcounttree.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
> index ee43e51188be..da99c80f49da 100644
> --- a/fs/ocfs2/refcounttree.c
> +++ b/fs/ocfs2/refcounttree.c
> @@ -154,6 +154,7 @@ ocfs2_refcount_cache_get_super(struct ocfs2_caching_info *ci)
>  }
>  
>  static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci)
> +	__acquires(&rf->rf_lock)
>  {
>  	struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci);
>  
> @@ -161,6 +162,7 @@ static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci)
>  }
>  
>  static void ocfs2_refcount_cache_unlock(struct ocfs2_caching_info *ci)
> +	__releases(&rf->rf_lock)
>  {
>  	struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci);
>  
> 

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

* [Ocfs2-devel] [PATCH] ocfs2: Add missing annotations for ocfs2_refcount_cache_lock() and ocfs2_refcount_cache_unlock()
@ 2020-02-25  0:53   ` Joseph Qi
  0 siblings, 0 replies; 4+ messages in thread
From: Joseph Qi @ 2020-02-25  0:53 UTC (permalink / raw)
  To: Jules Irenge, boqun.feng
  Cc: joseph.qi, Mark Fasheh, Joel Becker,
	moderated list:ORACLE CLUSTER FILESYSTEM 2 (OCFS2),
	open list, Andrew Morton



On 2020/2/25 04:41, Jules Irenge wrote:
> Sparse reports warnings at ocfs2_refcount_cache_lock()
> 	and ocfs2_refcount_cache_unlock()
> 
> warning: context imbalance in ocfs2_refcount_cache_lock()
> 	- wrong count at exit
> warning: context imbalance in ocfs2_refcount_cache_unlock()
> 	- unexpected unlock
> 
> The root cause is the missing annotation at ocfs2_refcount_cache_lock()
> 	and at ocfs2_refcount_cache_unlock()
> 
> Add the missing __acquires(&rf->rf_lock) annotation
> 	to ocfs2_refcount_cache_lock()
> Add the missing __releases(&rf->rf_lock) annotation
> 	to ocfs2_refcount_cache_unlock()
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
>  fs/ocfs2/refcounttree.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
> index ee43e51188be..da99c80f49da 100644
> --- a/fs/ocfs2/refcounttree.c
> +++ b/fs/ocfs2/refcounttree.c
> @@ -154,6 +154,7 @@ ocfs2_refcount_cache_get_super(struct ocfs2_caching_info *ci)
>  }
>  
>  static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci)
> +	__acquires(&rf->rf_lock)
>  {
>  	struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci);
>  
> @@ -161,6 +162,7 @@ static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci)
>  }
>  
>  static void ocfs2_refcount_cache_unlock(struct ocfs2_caching_info *ci)
> +	__releases(&rf->rf_lock)
>  {
>  	struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci);
>  
> 

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

end of thread, other threads:[~2020-02-25  0:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24 20:41 [PATCH] ocfs2: Add missing annotations for ocfs2_refcount_cache_lock() and ocfs2_refcount_cache_unlock() Jules Irenge
2020-02-24 20:41 ` [Ocfs2-devel] " Jules Irenge
2020-02-25  0:53 ` Joseph Qi
2020-02-25  0:53   ` [Ocfs2-devel] " Joseph Qi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.