diff mbox

[1/2] fix lockdep warning

Message ID 1317639399-4522-1-git-send-email-hans.schillstrom@ericsson.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Hans Schillstrom Oct. 3, 2011, 10:56 a.m. UTC
From: Hans Schillstrom <hans@schillstrom.com>

rs_lock needs a key to make lock dep happy.

Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>

Comments

Simon Horman Oct. 4, 2011, 9:14 p.m. UTC | #1
On Mon, Oct 03, 2011 at 12:56:38PM +0200, Hans Schillstrom wrote:
> From: Hans Schillstrom <hans@schillstrom.com>
> 
> rs_lock needs a key to make lock dep happy.
> 
> Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>

Hi Julian,

can I get an Ack or otherwise from you on this patch?

I already have one for
[PATCH 2/2] IPVS netns shutdown/startup dead-lock (Take III)

> 
> diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
> index 2b771dc..a1af72f 100644
> --- a/net/netfilter/ipvs/ip_vs_ctl.c
> +++ b/net/netfilter/ipvs/ip_vs_ctl.c
> @@ -57,6 +57,7 @@ static DEFINE_MUTEX(__ip_vs_mutex);
>  
>  /* lock for service table */
>  static DEFINE_RWLOCK(__ip_vs_svc_lock);
> +static struct lock_class_key ip_vs_rs_key;
>  
>  /* sysctl variables */
>  
> @@ -3680,6 +3681,7 @@ int __net_init ip_vs_control_net_init(struct net *net)
>  	struct netns_ipvs *ipvs = net_ipvs(net);
>  
>  	ipvs->rs_lock = __RW_LOCK_UNLOCKED(ipvs->rs_lock);
> +	__rwlock_init(&ipvs->rs_lock, "ipvs->rs_lock", &ip_vs_rs_key);
>  
>  	/* Initialize rs_table */
>  	for (idx = 0; idx < IP_VS_RTAB_SIZE; idx++)
> -- 
> 1.7.4.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Julian Anastasov Oct. 4, 2011, 10:51 p.m. UTC | #2
Hello,

On Mon, 3 Oct 2011, Hans Schillstrom wrote:

> From: Hans Schillstrom <hans@schillstrom.com>
> 
> rs_lock needs a key to make lock dep happy.
> 
> Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
> 
> diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
> index 2b771dc..a1af72f 100644
> --- a/net/netfilter/ipvs/ip_vs_ctl.c
> +++ b/net/netfilter/ipvs/ip_vs_ctl.c
> @@ -57,6 +57,7 @@ static DEFINE_MUTEX(__ip_vs_mutex);
>  
>  /* lock for service table */
>  static DEFINE_RWLOCK(__ip_vs_svc_lock);
> +static struct lock_class_key ip_vs_rs_key;

	ip_vs_rs_key remains unused without debugging. I don't
remember the reason why IPVS is the only place that calls
__rwlock_init instead of rwlock_init. Can we use rwlock_init?

>  /* sysctl variables */
>  
> @@ -3680,6 +3681,7 @@ int __net_init ip_vs_control_net_init(struct net *net)
>  	struct netns_ipvs *ipvs = net_ipvs(net);
>  
>  	ipvs->rs_lock = __RW_LOCK_UNLOCKED(ipvs->rs_lock);
> +	__rwlock_init(&ipvs->rs_lock, "ipvs->rs_lock", &ip_vs_rs_key);
>  
>  	/* Initialize rs_table */
>  	for (idx = 0; idx < IP_VS_RTAB_SIZE; idx++)
> -- 
> 1.7.4.4

Regards

--
Julian Anastasov <ja@ssi.bg>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hans Schillstrom Oct. 5, 2011, 6:31 a.m. UTC | #3
On Wednesday, October 05, 2011 00:51:31 Julian Anastasov wrote:
> 
> 	Hello,
> 
> On Mon, 3 Oct 2011, Hans Schillstrom wrote:
> 
[snip]
> 
> 	ip_vs_rs_key remains unused without debugging. I don't
> remember the reason why IPVS is the only place that calls
> __rwlock_init instead of rwlock_init. Can we use rwlock_init?

I'm Sorry, this was not meant to go to the list :-(
It should be rwlock_init() as you say 
I'll send a new one row patch...


Thanks
Hans
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 2b771dc..a1af72f 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -57,6 +57,7 @@  static DEFINE_MUTEX(__ip_vs_mutex);
 
 /* lock for service table */
 static DEFINE_RWLOCK(__ip_vs_svc_lock);
+static struct lock_class_key ip_vs_rs_key;
 
 /* sysctl variables */
 
@@ -3680,6 +3681,7 @@  int __net_init ip_vs_control_net_init(struct net *net)
 	struct netns_ipvs *ipvs = net_ipvs(net);
 
 	ipvs->rs_lock = __RW_LOCK_UNLOCKED(ipvs->rs_lock);
+	__rwlock_init(&ipvs->rs_lock, "ipvs->rs_lock", &ip_vs_rs_key);
 
 	/* Initialize rs_table */
 	for (idx = 0; idx < IP_VS_RTAB_SIZE; idx++)