linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] dax: Add missing annotation for wait_entry_unlocked()
@ 2020-04-01 15:33 Jules Irenge
  2020-04-15 10:42 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Jules Irenge @ 2020-04-01 15:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jules Irenge, Matthew Wilcox, Jan Kara, Alexander Viro,
	open list:FILESYSTEM DIRECT ACCESS DAX,
	open list:FILESYSTEM DIRECT ACCESS DAX

Sparse reports a warning at wait_entry_unlocked()

warning: context imbalance in wait_entry_unlocked() - unexpected unlock

The root cause is the missing annotation at wait_entry_unlocked()
Add the missing __releases(xas->xa->xa_lock) annotation

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

diff --git a/fs/dax.c b/fs/dax.c
index 35da144375a0..ee0468af4d81 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -244,6 +244,7 @@ static void *get_unlocked_entry(struct xa_state *xas, unsigned int order)
  * After we call xas_unlock_irq(), we cannot touch xas->xa.
  */
 static void wait_entry_unlocked(struct xa_state *xas, void *entry)
+	__releases(xas->xa->xa_lock)
 {
 	struct wait_exceptional_entry_queue ewait;
 	wait_queue_head_t *wq;
-- 
Change since v2
- gives more accurate lock variable name
2.25.1
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

* Re: [PATCH v2] dax: Add missing annotation for wait_entry_unlocked()
  2020-04-01 15:33 [PATCH v2] dax: Add missing annotation for wait_entry_unlocked() Jules Irenge
@ 2020-04-15 10:42 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2020-04-15 10:42 UTC (permalink / raw)
  To: Jules Irenge
  Cc: linux-kernel, Matthew Wilcox, Jan Kara, Alexander Viro,
	open list:FILESYSTEM DIRECT ACCESS (DAX),
	open list:FILESYSTEM DIRECT ACCESS (DAX)

On Wed 01-04-20 16:33:59, Jules Irenge wrote:
> Sparse reports a warning at wait_entry_unlocked()
> 
> warning: context imbalance in wait_entry_unlocked() - unexpected unlock
> 
> The root cause is the missing annotation at wait_entry_unlocked()
> Add the missing __releases(xas->xa->xa_lock) annotation
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

The patch looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/dax.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/dax.c b/fs/dax.c
> index 35da144375a0..ee0468af4d81 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -244,6 +244,7 @@ static void *get_unlocked_entry(struct xa_state *xas, unsigned int order)
>   * After we call xas_unlock_irq(), we cannot touch xas->xa.
>   */
>  static void wait_entry_unlocked(struct xa_state *xas, void *entry)
> +	__releases(xas->xa->xa_lock)
>  {
>  	struct wait_exceptional_entry_queue ewait;
>  	wait_queue_head_t *wq;
> -- 
> Change since v2
> - gives more accurate lock variable name
> 2.25.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

end of thread, other threads:[~2020-04-15 10:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01 15:33 [PATCH v2] dax: Add missing annotation for wait_entry_unlocked() Jules Irenge
2020-04-15 10:42 ` Jan Kara

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).