Thread (15 messages) flat view 15 messages, 5 authors, 2017-03-20

Re: [PATCH] [PATCH net] net: Do not hold the reference for the same sk_rx_dst.

From: Cong Wang <hidden>
Date: 2017-03-16 18:42:32

On Thu, Mar 16, 2017 at 11:18 AM, Kaiwen Xu [off-list ref] wrote:
On Thu, Mar 16, 2017 at 11:45:03AM +0100, Jakub Sitnicki wrote:
quoted
On Thu, Mar 16, 2017 at 10:12 AM GMT, Kevin Xu wrote:
quoted
Do you mean the message looping endlessly?
No, the message is emitted just once. Around 100 seconds after
destroying a few namespaces. Occurs not so often, maybe once per ten
runs.

-Jakub
I saw that happening from time to time during my test as well, I suspect
it was because some TCP sockets stays in either TCP_TIME_WAIT or
TCP_FIN_WAIT1. But eventually those sockets get destroyed and lo gets
deleted as well.
But TIMEWAIT sockets are purged by inet_twsk_purge() during netns
destroy, apparently before lo is destroyed.
The patch was fixing an issue I am seeing, that the message gets looped
forever, and causing a deadlock on new network ns creation.
But as DaveM said, the race still could happen after your patch,
the if check you add is not atomic at all.

Also, we should already lock the sock at the time we call
inet_sk_rx_dst_set(), but perhaps not for TCP_LISTEN case...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help