All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] dax: Add missing annotations for dax_read_lock() and dax_read_unlock()
@ 2020-02-24  1:50 ` Jules Irenge
  0 siblings, 0 replies; 2+ messages in thread
From: Jules Irenge @ 2020-02-24  1:50 UTC (permalink / raw)
  To: boqun.feng
  Cc: vishal.l.verma, linux-nvdimm, linux-kernel, yi.zhang, Jules Irenge

Sparse reports warnings at dax_read_lock() and dax_read_unlock()

warning: context imbalance in dax_read_lock() - wrong count at exit
warning: context imbalance in dax_read_unlock() - unexpected unlock

The root cause is the missing annotations at dax_read_lock()
	and dax_read_unlock()

Add the missing __acquires(&dax_srcu) annotation to dax_read_lock()
Add the missing __releases(&dax_srcu) annotation to dax_read_unlock()

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
Changes since V1
Correct commit log typing mistakes

 drivers/dax/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dax/super.c b/drivers/dax/super.c
index 26a654dbc69a..f872a2fb98d4 100644
--- a/drivers/dax/super.c
+++ b/drivers/dax/super.c
@@ -28,13 +28,13 @@ static struct super_block *dax_superblock __read_mostly;
 static struct hlist_head dax_host_list[DAX_HASH_SIZE];
 static DEFINE_SPINLOCK(dax_host_lock);
 
-int dax_read_lock(void)
+int dax_read_lock(void) __acquires(&dax_srcu)
 {
 	return srcu_read_lock(&dax_srcu);
 }
 EXPORT_SYMBOL_GPL(dax_read_lock);
 
-void dax_read_unlock(int id)
+void dax_read_unlock(int id) __releases(&dax_srcu)
 {
 	srcu_read_unlock(&dax_srcu, id);
 }
-- 
2.24.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

* [PATCH v2] dax: Add missing annotations for dax_read_lock() and dax_read_unlock()
@ 2020-02-24  1:50 ` Jules Irenge
  0 siblings, 0 replies; 2+ messages in thread
From: Jules Irenge @ 2020-02-24  1:50 UTC (permalink / raw)
  To: boqun.feng
  Cc: dan.j.williams, vishal.l.verma, dave.jiang, linux-nvdimm,
	linux-kernel, yi.zhang, Jules Irenge

Sparse reports warnings at dax_read_lock() and dax_read_unlock()

warning: context imbalance in dax_read_lock() - wrong count at exit
warning: context imbalance in dax_read_unlock() - unexpected unlock

The root cause is the missing annotations at dax_read_lock()
	and dax_read_unlock()

Add the missing __acquires(&dax_srcu) annotation to dax_read_lock()
Add the missing __releases(&dax_srcu) annotation to dax_read_unlock()

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
Changes since V1
Correct commit log typing mistakes

 drivers/dax/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dax/super.c b/drivers/dax/super.c
index 26a654dbc69a..f872a2fb98d4 100644
--- a/drivers/dax/super.c
+++ b/drivers/dax/super.c
@@ -28,13 +28,13 @@ static struct super_block *dax_superblock __read_mostly;
 static struct hlist_head dax_host_list[DAX_HASH_SIZE];
 static DEFINE_SPINLOCK(dax_host_lock);
 
-int dax_read_lock(void)
+int dax_read_lock(void) __acquires(&dax_srcu)
 {
 	return srcu_read_lock(&dax_srcu);
 }
 EXPORT_SYMBOL_GPL(dax_read_lock);
 
-void dax_read_unlock(int id)
+void dax_read_unlock(int id) __releases(&dax_srcu)
 {
 	srcu_read_unlock(&dax_srcu, id);
 }
-- 
2.24.1


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

end of thread, other threads:[~2020-02-24  1:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24  1:50 [PATCH v2] dax: Add missing annotations for dax_read_lock() and dax_read_unlock() Jules Irenge
2020-02-24  1:50 ` Jules Irenge

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.