net_native: close() should not block
authorAlan Cox <alan@linux.intel.com>
Sat, 3 Jun 2017 22:48:31 +0000 (23:48 +0100)
committerAlan Cox <alan@linux.intel.com>
Sat, 3 Jun 2017 22:48:31 +0000 (23:48 +0100)
The close process is supposed to go on asynchronously behind the back of the
closing process.

This is important because we are going to stop processes from sleeping during
an execve()

Kernel/dev/net/net_native.c

index 6749a3c..9ed1154 100644 (file)
@@ -491,7 +491,10 @@ int net_connect(struct socket *s)
 void net_close(struct socket *s)
 {
        /* Caution here - the native tcp socket will hang around longer */
-       netn_synchronous_event(s, SS_CLOSED);
+       sd->newstate = SS_CLOSED;
+       netn_asynchronous_event(s, NEV_STATE|NEVW_STATE);
+       /* Don't block. We won't reuse the entry until it moves to
+          CLOSED state */
 }
 
 /*