On Jun 13,  9:56am, 6b...@6bone.informatik.uni-leipzig.de 
(6b...@6bone.informatik.uni-leipzig.de) wrote:
-- Subject: Re: nfs client kernel crash

| On Sat, 4 Jun 2016, Christos Zoulas wrote:
| 
| > | The PR/50432 may describe the same problem.
| >
| > Thanks!
| >
| > christos
| >
| 
| A few weeks ago I changed the storage of our netbsd mirror to nfs. Since 
| the change, the mirror crashes regularly. There are also other problems 
| with the nfs. So the mirror is not usable at the moment.
| 
| Can you have a look at the problem? Perhaps you can find a quick 
| workaround.

Can you try this? The first one might not apply cleanly since I changed
the loop, but it should work just the same if you put the spl stuff around
the old loop.

christos

Index: nfs_clntsocket.c
===================================================================
RCS file: /cvsroot/src/sys/nfs/nfs_clntsocket.c,v
retrieving revision 1.4
diff -u -u -r1.4 nfs_clntsocket.c
--- nfs_clntsocket.c    13 Jun 2016 14:23:26 -0000      1.4
+++ nfs_clntsocket.c    13 Jun 2016 14:29:31 -0000
@@ -324,7 +324,7 @@
        struct mbuf *mrep, *nam, *md;
        u_int32_t rxid, *tl;
        char *dpos, *cp2;
-       int error;
+       int error, s;
 
        /*
         * Loop around until we get our own reply
@@ -402,6 +402,7 @@
                 * Loop through the request list to match up the reply
                 * Iff no match, just drop the datagram
                 */
+               s = splsoftnet();
                TAILQ_FOREACH(rep, &nfs_reqq, r_chain) {
                        if (rep->r_mrep != NULL || rxid != rep->r_xid)
                                continue;
@@ -467,6 +468,7 @@
                        nmp->nm_timeouts = 0;
                        break;
                }
+               splx(s);
                nfs_rcvunlock(nmp);
                /*
                 * If not matched to a request, drop it.
Index: nfs_socket.c
===================================================================
RCS file: /cvsroot/src/sys/nfs/nfs_socket.c,v
retrieving revision 1.197
diff -u -u -r1.197 nfs_socket.c
--- nfs_socket.c        15 Jul 2015 03:28:55 -0000      1.197
+++ nfs_socket.c        13 Jun 2016 14:29:31 -0000
@@ -349,7 +349,7 @@
 {
        struct nfsreq *rp;
        struct nfsmount *nmp = rep->r_nmp;
-       int error;
+       int error, s;
        time_t before_ts;
 
        nfs_disconnect(nmp);
@@ -384,6 +384,7 @@
         * Loop through outstanding request list and fix up all requests
         * on old socket.
         */
+       s = splsoftnet();
        TAILQ_FOREACH(rp, &nfs_reqq, r_chain) {
                if (rp->r_nmp == nmp) {
                        if ((rp->r_flags & R_MUSTRESEND) == 0)
@@ -391,6 +392,7 @@
                        rp->r_rexmit = 0;
                }
        }
+       splx(s);
        return (0);
 }
 

christos

Reply via email to