• Trond Myklebust's avatar
    SUNRPC: Add the equivalent of the linger and linger2 timeouts to RPC sockets · 7d1e8255
    Trond Myklebust authored
    This fixes a regression against FreeBSD servers as reported by Tomas
    Kasparek. Apparently when using RPC over a TCP socket, the FreeBSD servers
    don't ever react to the client closing the socket, and so commit
    e06799f9 (SUNRPC: Use shutdown() instead of
    close() when disconnecting a TCP socket) causes the setup to hang forever
    whenever the client attempts to close and then reconnect.
    
    We break the deadlock by adding a 'linger2' style timeout to the socket,
    after which, the client will abort the connection using a TCP 'RST'.
    
    The default timeout is set to 15 seconds. A subsequent patch will put it
    under user control by means of a systctl.
    Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
    7d1e8255
xprtsock.c 56.6 KB