Re: [PATCH v3 net] packet: Do not call fanout_release from atomic contexts

2017-02-17 Thread David Miller
From: Anoob Soman Date: Wed, 15 Feb 2017 20:25:39 + > Commit 6664498280cf ("packet: call fanout_release, while UNREGISTERING a > netdev"), unfortunately, introduced the following issues. ... > To fix the above problems, remove the call to fanout_release() under > rcu_read_lock(). Instead, ca

Re: [PATCH v3 net] packet: Do not call fanout_release from atomic contexts

2017-02-15 Thread Eric Dumazet
On Wed, 2017-02-15 at 21:30 +, Anoob Soman wrote: > If statement looks like this. > if (atomic_dec_and_test(sk_ref)) > list_del(f->list); > else > f = NULL; > > there are no multiple lines under if. Yes, I just noticed that. Thanks.

Re: [PATCH v3 net] packet: Do not call fanout_release from atomic contexts

2017-02-15 Thread Eric Dumazet
On Wed, 2017-02-15 at 13:02 -0800, Eric Dumazet wrote: > On Wed, 2017-02-15 at 20:25 +, Anoob Soman wrote: > > > +static struct packet_fanout *fanout_release(struct sock *sk) > > { > > struct packet_sock *po = pkt_sk(sk); > > struct packet_fanout *f; > > @@ -1728,17 +1736,17 @@ static

Re: [PATCH v3 net] packet: Do not call fanout_release from atomic contexts

2017-02-15 Thread Anoob Soman
On 15/02/17 21:02, Eric Dumazet wrote: On Wed, 2017-02-15 at 20:25 +, Anoob Soman wrote: +static struct packet_fanout *fanout_release(struct sock *sk) { struct packet_sock *po = pkt_sk(sk); struct packet_fanout *f; @@ -1728,17 +1736,17 @@ static void fanout_release(struct

Re: [PATCH v3 net] packet: Do not call fanout_release from atomic contexts

2017-02-15 Thread Eric Dumazet
On Wed, 2017-02-15 at 20:25 +, Anoob Soman wrote: > +static struct packet_fanout *fanout_release(struct sock *sk) > { > struct packet_sock *po = pkt_sk(sk); > struct packet_fanout *f; > @@ -1728,17 +1736,17 @@ static void fanout_release(struct sock *sk) > if (f) { >

[PATCH v3 net] packet: Do not call fanout_release from atomic contexts

2017-02-15 Thread Anoob Soman
Commit 6664498280cf ("packet: call fanout_release, while UNREGISTERING a netdev"), unfortunately, introduced the following issues. 1. calling mutex_lock(&fanout_mutex) (fanout_release()) from inside rcu_read-side critical section. rcu_read_lock disables preemption, most often, which prohibits call