aboutsummaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_serv.c
diff options
context:
space:
mode:
authorDoug Rabson <dfr@FreeBSD.org>1997-05-10 16:12:03 +0000
committerDoug Rabson <dfr@FreeBSD.org>1997-05-10 16:12:03 +0000
commit5ae0f71815d5e8e1fcd919f28e0d131f70eeb456 (patch)
tree689096249f70d6f3df4b453897d1be31f816e58f /sys/nfs/nfs_serv.c
parent057df964f492d99406332766d7cd611eef2d12b9 (diff)
downloadsrc-5ae0f71815d5e8e1fcd919f28e0d131f70eeb456.tar.gz
src-5ae0f71815d5e8e1fcd919f28e0d131f70eeb456.zip
Fix a nasty hang connected with write gathering. Also add debug print
statements to bits of the server which helped me find the hang.
Notes
Notes: svn path=/head/; revision=25663
Diffstat (limited to 'sys/nfs/nfs_serv.c')
-rw-r--r--sys/nfs/nfs_serv.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index a0d513646c02..7946328e1b13 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
- * $Id: nfs_serv.c,v 1.39 1997/03/25 05:13:40 peter Exp $
+ * $Id: nfs_serv.c,v 1.40 1997/03/29 12:40:18 bde Exp $
*/
/*
@@ -999,6 +999,7 @@ nfsmout:
owp = wp;
wp = wp->nd_tq.le_next;
}
+ NFS_DPF(WG, ("Q%03x", nfsd->nd_retxid & 0xfff));
if (owp) {
LIST_INSERT_AFTER(owp, nfsd, nd_tq);
} else {
@@ -1050,6 +1051,7 @@ loop1:
break;
if (nfsd->nd_mreq)
continue;
+ NFS_DPF(WG, ("P%03x", nfsd->nd_retxid & 0xfff));
LIST_REMOVE(nfsd, nd_tq);
LIST_REMOVE(nfsd, nd_hash);
splx(s);
@@ -1126,6 +1128,7 @@ loop1:
*/
swp = nfsd;
do {
+ NFS_DPF(WG, ("R%03x", nfsd->nd_retxid & 0xfff));
if (error) {
nfsm_writereply(NFSX_WCCDATA(v3), v3);
if (v3) {
@@ -1185,6 +1188,7 @@ loop1:
s = splsoftclock();
for (nfsd = slp->ns_tq.lh_first; nfsd; nfsd = nfsd->nd_tq.le_next)
if (nfsd->nd_mreq) {
+ NFS_DPF(WG, ("X%03x", nfsd->nd_retxid & 0xfff));
LIST_REMOVE(nfsd, nd_tq);
*mrq = nfsd->nd_mreq;
*ndp = nfsd;
@@ -1209,7 +1213,10 @@ nfsrvw_coalesce(owp, nfsd)
{
register int overlap;
register struct mbuf *mp;
+ struct nfsrv_descript *p;
+ NFS_DPF(WG, ("C%03x-%03x",
+ nfsd->nd_retxid & 0xfff, owp->nd_retxid & 0xfff));
LIST_REMOVE(nfsd, nd_hash);
LIST_REMOVE(nfsd, nd_tq);
if (owp->nd_eoff < nfsd->nd_eoff) {
@@ -1232,6 +1239,16 @@ nfsrvw_coalesce(owp, nfsd)
owp->nd_stable == NFSV3WRITE_UNSTABLE)
owp->nd_stable = NFSV3WRITE_DATASYNC;
LIST_INSERT_HEAD(&owp->nd_coalesce, nfsd, nd_tq);
+
+ /*
+ * If nfsd had anything else coalesced into it, transfer them
+ * to owp, otherwise their replies will never get sent.
+ */
+ for (p = nfsd->nd_coalesce.lh_first; p;
+ p = nfsd->nd_coalesce.lh_first) {
+ LIST_REMOVE(p, nd_tq);
+ LIST_INSERT_HEAD(&owp->nd_coalesce, p, nd_tq);
+ }
}
/*