[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 8 Aug 2008 22:37:42 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: "Michael S. Tsirkin" <m.s.tsirkin@...il.com>
Cc: linux-kernel@...r.kernel.org, davem@...emloft.net,
yoshfuji@...ux-ipv6.org, netdev@...r.kernel.org, haoki@...hat.com
Subject: Re: possible recursive locking in udp4_lib_rcv
On Fri, Aug 08, 2008 at 10:28:41PM +0800, Herbert Xu wrote:
>
> @@ -1165,7 +1189,13 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
> inet_iif(skb), udptable);
>
> if (sk != NULL) {
> - int ret = udp_queue_rcv_skb(sk, skb);
> + int ret = 0;
> + bh_lock_sock_nested(sk);
> + if (!sock_owned_by_user(sk))
> + ret = udp_queue_rcv_skb(sk, skb);
> + else
> + sk_add_backlog(sk, skb);
> + bh_unlock_sock(sk);
>
> Hmm, what was the reason for that lock?
Never mind, I see the reason why it's there. What we should do
is drop the lock when we hit an encapsulated socket since they
don't need it at all.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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