diff options
author | ps <ps@FreeBSD.org> | 2005-12-12 23:18:05 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2005-12-12 23:18:05 +0000 |
commit | 3b0631d180c966079f2829fd3a8fea00fc26a713 (patch) | |
tree | 802aee320bd534dfb495c9cd9d308524fd68fea9 | |
parent | 5aa0590aa8779193961836d3b206d315ce891ae8 (diff) | |
download | FreeBSD-src-3b0631d180c966079f2829fd3a8fea00fc26a713.zip FreeBSD-src-3b0631d180c966079f2829fd3a8fea00fc26a713.tar.gz |
Improve upon rev 1.133 where NFS/TCP would not reconnect.
Submitted by: Mohan Srinivasan
-rw-r--r-- | sys/nfsclient/nfs_socket.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index ed826f8..4b5d0fc 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -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 @@ tryagain: } 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); |