Improve upon rev 1.133 where NFS/TCP would not reconnect.
Submitted by: Mohan Srinivasan
This commit is contained in:
parent
6bcdd71391
commit
fc6ff223c4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153365
@ -523,17 +523,6 @@ nfs_send(struct socket *so, struct sockaddr *nam, struct mbuf *top,
|
||||
return (error);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
nfs_cantrecvmore(struct socket *so)
|
||||
{
|
||||
int ret;
|
||||
|
||||
SOCKBUF_LOCK(&so->so_rcv);
|
||||
ret = (so->so_rcv.sb_state & SBS_CANTRCVMORE);
|
||||
SOCKBUF_UNLOCK(&so->so_rcv);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
nfs_reply(struct nfsreq *rep)
|
||||
{
|
||||
@ -563,7 +552,7 @@ nfs_reply(struct nfsreq *rep)
|
||||
}
|
||||
so = rep->r_nmp->nm_so;
|
||||
mtx_lock(&rep->r_nmp->nm_nfstcpstate.mtx);
|
||||
if (!so || nfs_cantrecvmore(so) ||
|
||||
if (!so ||
|
||||
(rep->r_nmp->nm_nfstcpstate.flags & NFS_TCP_FORCE_RECONNECT)) {
|
||||
mtx_unlock(&rep->r_nmp->nm_nfstcpstate.mtx);
|
||||
error = nfs_reconnect(rep);
|
||||
@ -767,7 +756,7 @@ nfstcp_readable(struct socket *so, int bytes)
|
||||
|
||||
SOCKBUF_LOCK(&so->so_rcv);
|
||||
retval = (so->so_rcv.sb_cc >= (bytes) ||
|
||||
(so->so_state & SBS_CANTRCVMORE) ||
|
||||
(so->so_rcv.sb_state & SBS_CANTRCVMORE) ||
|
||||
so->so_error);
|
||||
SOCKBUF_UNLOCK(&so->so_rcv);
|
||||
return (retval);
|
||||
|
Loading…
Reference in New Issue
Block a user