Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: NFS: Fix an Oops in the NFSv4 atomic open code NFS: Fix the selection of security flavours in Kconfig NFS: fix the return value of nfs_file_fsync() rpcrdma: Fix SQ size calculation when memreg is FRMR xprtrdma: Do not truncate iova_start values in frmr registrations. nfs: Remove redundant NULL check upon kfree() nfs: Add "lookupcache" to displayed mount options NFS: allow close-to-open cache semantics to apply to root of NFS filesystem SUNRPC: fix NFS client over TCP hangs due to packet loss (Bug 16494)
This commit is contained in:
+22
-6
@@ -1305,10 +1305,11 @@ static void xs_tcp_state_change(struct sock *sk)
|
||||
if (!(xprt = xprt_from_sock(sk)))
|
||||
goto out;
|
||||
dprintk("RPC: xs_tcp_state_change client %p...\n", xprt);
|
||||
dprintk("RPC: state %x conn %d dead %d zapped %d\n",
|
||||
dprintk("RPC: state %x conn %d dead %d zapped %d sk_shutdown %d\n",
|
||||
sk->sk_state, xprt_connected(xprt),
|
||||
sock_flag(sk, SOCK_DEAD),
|
||||
sock_flag(sk, SOCK_ZAPPED));
|
||||
sock_flag(sk, SOCK_ZAPPED),
|
||||
sk->sk_shutdown);
|
||||
|
||||
switch (sk->sk_state) {
|
||||
case TCP_ESTABLISHED:
|
||||
@@ -1779,10 +1780,25 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt, struct sock_xprt *tra
|
||||
{
|
||||
unsigned int state = transport->inet->sk_state;
|
||||
|
||||
if (state == TCP_CLOSE && transport->sock->state == SS_UNCONNECTED)
|
||||
return;
|
||||
if ((1 << state) & (TCPF_ESTABLISHED|TCPF_SYN_SENT))
|
||||
return;
|
||||
if (state == TCP_CLOSE && transport->sock->state == SS_UNCONNECTED) {
|
||||
/* we don't need to abort the connection if the socket
|
||||
* hasn't undergone a shutdown
|
||||
*/
|
||||
if (transport->inet->sk_shutdown == 0)
|
||||
return;
|
||||
dprintk("RPC: %s: TCP_CLOSEd and sk_shutdown set to %d\n",
|
||||
__func__, transport->inet->sk_shutdown);
|
||||
}
|
||||
if ((1 << state) & (TCPF_ESTABLISHED|TCPF_SYN_SENT)) {
|
||||
/* we don't need to abort the connection if the socket
|
||||
* hasn't undergone a shutdown
|
||||
*/
|
||||
if (transport->inet->sk_shutdown == 0)
|
||||
return;
|
||||
dprintk("RPC: %s: ESTABLISHED/SYN_SENT "
|
||||
"sk_shutdown set to %d\n",
|
||||
__func__, transport->inet->sk_shutdown);
|
||||
}
|
||||
xs_abort_connection(xprt, transport);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user