summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2001-07-06 21:51:14 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2001-07-06 21:51:14 +0000
commitb5f78002fd1e930731829e73c6b63aa793791c51 (patch)
treebf520958e648d37d4bafb086cf2a97cea4f09e1f
parent64c28c3b97aef34653cf92fde589f0f3e8a33197 (diff)
From NetBSD; Server could lose requests during write-gathering, causing client
hangs. Fixes the old typical pwd_mkdb waiting on getblk hang during make release over NFS.
-rw-r--r--sys/nfs/nfs_serv.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 1549d6aba55..95c6b87bc19 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: nfs_serv.c,v 1.23 2001/06/27 04:58:46 art Exp $ */
-/* $NetBSD: nfs_serv.c,v 1.25 1996/03/02 15:55:52 jtk Exp $ */
+/* $OpenBSD: nfs_serv.c,v 1.24 2001/07/06 21:51:13 niklas Exp $ */
+/* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -1202,6 +1202,19 @@ nfsrvw_coalesce(owp, nfsd)
owp->nd_stable == NFSV3WRITE_UNSTABLE)
owp->nd_stable = NFSV3WRITE_DATASYNC;
LIST_INSERT_HEAD(&owp->nd_coalesce, nfsd, nd_tq);
+
+ /*
+ * nfsd might hold coalesce elements! Move them to owp.
+ * Otherwise, requests may be lost and clients will be stuck.
+ */
+ if (LIST_FIRST(&nfsd->nd_coalesce) != NULL) {
+ struct nfsrv_descript *m;
+
+ while ((m = LIST_FIRST(&nfsd->nd_coalesce)) != NULL) {
+ LIST_REMOVE(m, nd_tq);
+ LIST_INSERT_HEAD(&owp->nd_coalesce, m, nd_tq);
+ }
+ }
}
/*