* [PATCH] macvtap: remove wrong sock_put() in macvtap_put_queue()
@ 2011-06-13 3:15 Jason Wang
2011-06-17 2:58 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jason Wang @ 2011-06-13 3:15 UTC (permalink / raw)
To: davem, arnd, netdev, linux-kernel; +Cc: Jason Wang
The calling of sock_put() should be delayed after synchronize_rcu(),
otherwise inconsist data may be seen during packets transmitting.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/macvtap.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 6696e56..ecdb775 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -148,7 +148,6 @@ static void macvtap_put_queue(struct macvtap_queue *q)
rcu_assign_pointer(vlan->taps[index], NULL);
rcu_assign_pointer(q->vlan, NULL);
- sock_put(&q->sk);
--vlan->numvtaps;
}
--
1.7.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] macvtap: remove wrong sock_put() in macvtap_put_queue()
2011-06-13 3:15 [PATCH] macvtap: remove wrong sock_put() in macvtap_put_queue() Jason Wang
@ 2011-06-17 2:58 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-06-17 2:58 UTC (permalink / raw)
To: jasowang; +Cc: arnd, netdev, linux-kernel
From: Jason Wang <jasowang@redhat.com>
Date: Mon, 13 Jun 2011 11:15:19 +0800
> The calling of sock_put() should be delayed after synchronize_rcu(),
> otherwise inconsist data may be seen during packets transmitting.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
You're leaking sockets now.
This function has to release the socket twice if there is
a non-NULL vlan assigned to the queue.
Now you're only doing it once in that situation.
Which probably fixes your crash, but adds a socket leak.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-17 2:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-13 3:15 [PATCH] macvtap: remove wrong sock_put() in macvtap_put_queue() Jason Wang
2011-06-17 2:58 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®