Skip to contentSkip to conversation

dax: Add missing annotation for wait_entry_unlocked()

PATCH In review Jules Irenge 2 participants 2 messages Apr 1, 2020 – Apr 15, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dax: Add missing annotation for wait_entry_unlocked()

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

---
 fs/dax.c | 1 +
 1 file changed, 1 insertion(+)
fs/dax.c +1 -0
index 35da144375a0..ee0468af4d81 100644
@@ -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;
Signature · 6 lines
Change since v2
- gives more accurate lock variable name
2.25.1
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]
reviewer Reviewed-by on v2 1/1
#1 lore raw
Quoted 8 lines · Jules Irenge

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

The patch looks good to me. You can add:

Honza

Quoted 21 lines
---
 fs/dax.c | 1 +
 1 file changed, 1 insertion(+)
fs/dax.c +1 -0
index 35da144375a0..ee0468af4d81 100644
@@ -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;
Signature · 3 lines
Change since v2
- gives more accurate lock variable name
2.25.1
Signature · 5 lines
Jan Kara <[email protected]>
SUSE Labs, CR
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]