From owner-freebsd-current Thu Jun 13 15:06:24 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA21660 for current-outgoing; Thu, 13 Jun 1996 15:06:24 -0700 (PDT) Received: from skynet.ctr.columbia.edu (skynet.ctr.columbia.edu [128.59.64.70]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id PAA21652 for ; Thu, 13 Jun 1996 15:06:17 -0700 (PDT) Received: (from wpaul@localhost) by skynet.ctr.columbia.edu (8.6.12/8.6.9) id SAA15142 for current@freebsd.org; Thu, 13 Jun 1996 18:04:49 -0400 From: Bill Paul Message-Id: <199606132204.SAA15142@skynet.ctr.columbia.edu> Subject: Patch for NFS_NOSERVER -- please test To: current@freebsd.org Date: Thu, 13 Jun 1996 18:04:48 -0400 (EDT) X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Appended to this message is a set of patches for nfs_socket.c and nfs_subs.c which seems to cure the problem with NFS_NOSERVER wedging up the system, at least for me. If anyone else is having trouble with this, please test these patches and get back to me. If it cures the problem, I'll commit them to the tree. Note that I am _not_ an NFS expert by any stretch of the imagination, so I check this over carefullty. It seems to have fixed all my problems: I'm using the system right now with a completely diskless configuration (everything mounted over NFS) without any problems. I even have the automounter running. But as usual, YMMV. Poul mentioned that he thought this was some kind of timing problem, and that started me thinking. After a little poking around, I found that nfs_timer() was completely disabled when NFS_NOSERVER was #defined. But after looking at nfs_timer(), it seemed like it was something required by both the client and server code, and disabling it outright just didn't seem to make any sense. Parts of it relate only to the NFS server side code, so I disabled those, but I re-enabled the rest of the function and made sure that it would be called from nfs_init() (in nfs_subs.c). With nfs_timer() re-enabled, everything seems to work again. The only other changes I made were to #ifdef away some variable declarations in the NFS_NOSERVER case so that gcc would stop complaining about unused variables. -Bill -- ============================================================================= -Bill Paul (212) 854-6020 | System Manager Work: wpaul@ctr.columbia.edu | Center for Telecommunications Research Home: wpaul@skynet.ctr.columbia.edu | Columbia University, New York City ============================================================================= License error: The license for this .sig file has expired. You must obtain a new license key before any more witty phrases will appear in this space. ============================================================================= *** nfs_socket.c.orig Thu Jun 13 17:40:04 1996 --- nfs_socket.c Thu Jun 13 17:31:13 1996 *************** *** 141,149 **** static int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname, struct mbuf **mp)); static int nfs_reconnect __P((struct nfsreq *rep)); static int nfsrv_getstream __P((struct nfssvc_sock *,int)); - #ifndef NFS_NOSERVER int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd, struct nfssvc_sock *slp, struct proc *procp, --- 141,149 ---- static int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname, struct mbuf **mp)); static int nfs_reconnect __P((struct nfsreq *rep)); + #ifndef NFS_NOSERVER static int nfsrv_getstream __P((struct nfssvc_sock *,int)); int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd, struct nfssvc_sock *slp, struct proc *procp, *************** *** 1267,1272 **** --- 1267,1273 ---- } + #endif /* NFS_NOSERVER */ /* * Nfs timer routine * Scan the nfsreq list and retranmit any requests that have timed out *************** *** 1282,1291 **** register struct socket *so; register struct nfsmount *nmp; register int timeo; - register struct nfssvc_sock *slp; - static long lasttime = 0; int s, error; u_quad_t cur_usec; s = splnet(); for (rep = nfs_reqq.tqh_first; rep != 0; rep = rep->r_chain.tqe_next) { --- 1283,1294 ---- register struct socket *so; register struct nfsmount *nmp; register int timeo; int s, error; + #ifndef NFS_NOSERVER + static long lasttime = 0; + register struct nfssvc_sock *slp; u_quad_t cur_usec; + #endif /* NFS_NOSERVER */ s = splnet(); for (rep = nfs_reqq.tqh_first; rep != 0; rep = rep->r_chain.tqe_next) { *************** *** 1374,1380 **** } } } ! /* * Call the nqnfs server timer once a second to handle leases. */ --- 1377,1383 ---- } } } ! #ifndef NFS_NOSERVER /* * Call the nqnfs server timer once a second to handle leases. */ *************** *** 1393,1403 **** if (slp->ns_tq.lh_first && slp->ns_tq.lh_first->nd_time<=cur_usec) nfsrv_wakenfsd(slp); } splx(s); timeout(nfs_timer, (void *)0, nfs_ticks); } - #endif /* NFS_NOSERVER */ /* * Test for a termination condition pending on the process. --- 1396,1406 ---- if (slp->ns_tq.lh_first && slp->ns_tq.lh_first->nd_time<=cur_usec) nfsrv_wakenfsd(slp); } + #endif /* NFS_NOSERVER */ splx(s); timeout(nfs_timer, (void *)0, nfs_ticks); } /* * Test for a termination condition pending on the process. *** nfs_subs.c.orig Thu Jun 13 17:39:58 1996 --- nfs_subs.c Thu Jun 13 17:37:11 1996 *************** *** 1147,1155 **** * Initialize reply list and start timer */ TAILQ_INIT(&nfs_reqq); ! #ifndef NFS_NOSERVER nfs_timer(0); ! #endif #ifdef __FreeBSD__ /* --- 1147,1155 ---- * Initialize reply list and start timer */ TAILQ_INIT(&nfs_reqq); ! nfs_timer(0); ! #ifdef __FreeBSD__ /*