lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat,  6 Jul 2013 17:41:24 +0530
From:	Ramkumar Ramachandra <artagnon@...il.com>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	David Howells <dhowells@...hat.com>,
	Trond Myklebust <Trond.Myklebust@...app.com>
Subject: [PATCH 1/3] nfs: add lock annotations to squelch sparse warnings

sparse, being a static analyzer, emits the following warnings:

  context imbalance in 'nfs_server_list_start' - wrong count at exit
  context imbalance in 'nfs_server_list_start' - unexpected unlock
  context imbalance in 'nfs_volume_list_start' - wrong count at exit
  context imbalance in 'nfs_volume_list_start' - unexpected unlock

Help it by annotating the pairs of functions with __acquires and
__releases.

Cc: David Howells <dhowells@...hat.com>
Cc: Trond Myklebust <Trond.Myklebust@...app.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@...il.com>
---
 fs/nfs/client.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index c513b0c..2a32ac8 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1253,6 +1253,7 @@ static int nfs_server_list_open(struct inode *inode, struct file *file)
  * set up the iterator to start reading from the server list and return the first item
  */
 static void *nfs_server_list_start(struct seq_file *m, loff_t *_pos)
+	__acquires(&nn->nfs_client_lock)
 {
 	struct nfs_net *nn = net_generic(m->private, nfs_net_id);
 
@@ -1275,6 +1276,7 @@ static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos)
  * clean up after reading from the transports list
  */
 static void nfs_server_list_stop(struct seq_file *p, void *v)
+	__releases(&nn->nfs_client_lock)
 {
 	struct nfs_net *nn = net_generic(p->private, nfs_net_id);
 
@@ -1338,6 +1340,7 @@ static int nfs_volume_list_open(struct inode *inode, struct file *file)
  * set up the iterator to start reading from the volume list and return the first item
  */
 static void *nfs_volume_list_start(struct seq_file *m, loff_t *_pos)
+	__acquires(&nn->nfs_client_lock)
 {
 	struct nfs_net *nn = net_generic(m->private, nfs_net_id);
 
@@ -1360,6 +1363,7 @@ static void *nfs_volume_list_next(struct seq_file *p, void *v, loff_t *pos)
  * clean up after reading from the transports list
  */
 static void nfs_volume_list_stop(struct seq_file *p, void *v)
+	__releases(&nn->nfs_client_lock)
 {
 	struct nfs_net *nn = net_generic(p->private, nfs_net_id);
 
-- 
1.8.3.2.733.gf8abaeb

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ