Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7-0]: src/sys/nfs Pull up following revision(s) (requested by chr...



details:   https://anonhg.NetBSD.org/src/rev/85708f88c606
branches:  netbsd-7-0
changeset: 801195:85708f88c606
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jul 10 08:38:54 2016 +0000

description:
Pull up following revision(s) (requested by christos in ticket #1184):
        sys/nfs/nfs_socket.c: revision 1.198
        sys/nfs/nfs_clntsocket.c: revision 1.5
Serialize all access to the NFS request queue via splsoftnet(). Fixes random
crashes.

diffstat:

 sys/nfs/nfs_clntsocket.c |  8 +++++---
 sys/nfs/nfs_socket.c     |  8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diffs (86 lines):

diff -r 0cc563cb7ed0 -r 85708f88c606 sys/nfs/nfs_clntsocket.c
--- a/sys/nfs/nfs_clntsocket.c  Wed Jun 22 08:31:21 2016 +0000
+++ b/sys/nfs/nfs_clntsocket.c  Sun Jul 10 08:38:54 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_clntsocket.c,v 1.1 2010/03/02 23:19:09 pooka Exp $ */
+/*     $NetBSD: nfs_clntsocket.c,v 1.1.42.1 2016/07/10 08:38:54 martin Exp $   */
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1995
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_clntsocket.c,v 1.1 2010/03/02 23:19:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_clntsocket.c,v 1.1.42.1 2016/07/10 08:38:54 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -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) {
                                /* Found it.. */
@@ -465,6 +466,7 @@
                                break;
                        }
                }
+               splx(s);
                nfs_rcvunlock(nmp);
                /*
                 * If not matched to a request, drop it.
diff -r 0cc563cb7ed0 -r 85708f88c606 sys/nfs/nfs_socket.c
--- a/sys/nfs/nfs_socket.c      Wed Jun 22 08:31:21 2016 +0000
+++ b/sys/nfs/nfs_socket.c      Sun Jul 10 08:38:54 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_socket.c,v 1.192 2014/08/05 07:55:32 rtr Exp $     */
+/*     $NetBSD: nfs_socket.c,v 1.192.4.1 2016/07/10 08:38:54 martin Exp $      */
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1995
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.192 2014/08/05 07:55:32 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.192.4.1 2016/07/10 08:38:54 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -357,7 +357,7 @@
 {
        struct nfsreq *rp;
        struct nfsmount *nmp = rep->r_nmp;
-       int error;
+       int error, s;
 
        nfs_disconnect(nmp);
        while ((error = nfs_connect(nmp, rep, &lwp0)) != 0) {
@@ -370,6 +370,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)
@@ -377,6 +378,7 @@
                        rp->r_rexmit = 0;
                }
        }
+       splx(s);
        return (0);
 }
 



Home | Main Index | Thread Index | Old Index