diff options
author | ps <ps@FreeBSD.org> | 2005-11-21 19:25:24 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2005-11-21 19:25:24 +0000 |
commit | 3278e302f06abc11573884d06ee50dc48fe6fc05 (patch) | |
tree | 2d24f17c86af06abf2c9e6bc121d7a87713de915 | |
parent | 6364b280f8c021890b7197124558e6b448888c03 (diff) | |
download | FreeBSD-src-3278e302f06abc11573884d06ee50dc48fe6fc05.zip FreeBSD-src-3278e302f06abc11573884d06ee50dc48fe6fc05.tar.gz |
Fix for a bug where NFS/TCP would not reconnect (in the case where
the server FIN'ed). Seen with Solaris NFS servers.
Reported by: TOMITA Yoshinori <yoshint@flab.fujitsu.co.jp>
Submitted by: Mohan Strinivasan
-rw-r--r-- | sys/nfsclient/nfs_socket.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 511e229..ed826f8 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -523,6 +523,17 @@ 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) { @@ -552,7 +563,7 @@ tryagain: } so = rep->r_nmp->nm_so; mtx_lock(&rep->r_nmp->nm_nfstcpstate.mtx); - if (!so || + if (!so || nfs_cantrecvmore(so) || (rep->r_nmp->nm_nfstcpstate.flags & NFS_TCP_FORCE_RECONNECT)) { mtx_unlock(&rep->r_nmp->nm_nfstcpstate.mtx); error = nfs_reconnect(rep); |