mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-15 19:18:02 +00:00
SUNRPC: Deal with the lack of a SYN_SENT sk->sk_state_change callback...
The TCP connection state code depends on the state_change() callback being called when the SYN_SENT state is set. However the networking layer doesn't actually call us back in that case. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org
This commit is contained in:
parent
61c4f2c81c
commit
fe19a96b10
1 changed files with 13 additions and 3 deletions
|
@ -1344,7 +1344,6 @@ static void xs_tcp_state_change(struct sock *sk)
|
||||||
case TCP_CLOSE_WAIT:
|
case TCP_CLOSE_WAIT:
|
||||||
/* The server initiated a shutdown of the socket */
|
/* The server initiated a shutdown of the socket */
|
||||||
xprt_force_disconnect(xprt);
|
xprt_force_disconnect(xprt);
|
||||||
case TCP_SYN_SENT:
|
|
||||||
xprt->connect_cookie++;
|
xprt->connect_cookie++;
|
||||||
case TCP_CLOSING:
|
case TCP_CLOSING:
|
||||||
/*
|
/*
|
||||||
|
@ -1758,6 +1757,7 @@ static void xs_tcp_reuse_connection(struct sock_xprt *transport)
|
||||||
static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
|
static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
|
||||||
{
|
{
|
||||||
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
|
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
|
||||||
|
int ret = -ENOTCONN;
|
||||||
|
|
||||||
if (!transport->inet) {
|
if (!transport->inet) {
|
||||||
struct sock *sk = sock->sk;
|
struct sock *sk = sock->sk;
|
||||||
|
@ -1789,12 +1789,22 @@ static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!xprt_bound(xprt))
|
if (!xprt_bound(xprt))
|
||||||
return -ENOTCONN;
|
goto out;
|
||||||
|
|
||||||
/* Tell the socket layer to start connecting... */
|
/* Tell the socket layer to start connecting... */
|
||||||
xprt->stat.connect_count++;
|
xprt->stat.connect_count++;
|
||||||
xprt->stat.connect_start = jiffies;
|
xprt->stat.connect_start = jiffies;
|
||||||
return kernel_connect(sock, xs_addr(xprt), xprt->addrlen, O_NONBLOCK);
|
ret = kernel_connect(sock, xs_addr(xprt), xprt->addrlen, O_NONBLOCK);
|
||||||
|
switch (ret) {
|
||||||
|
case 0:
|
||||||
|
case -EINPROGRESS:
|
||||||
|
/* SYN_SENT! */
|
||||||
|
xprt->connect_cookie++;
|
||||||
|
if (xprt->reestablish_timeout < XS_TCP_INIT_REEST_TO)
|
||||||
|
xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
|
||||||
|
}
|
||||||
|
out:
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue