Source-Changes-HG archive

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

[src/trunk]: src/sys/net Don't take softnet_lock in sysctl_rtable



details:   https://anonhg.NetBSD.org/src/rev/f53c94e84169
branches:  trunk
changeset: 999272:f53c94e84169
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon May 27 05:33:48 2019 +0000

description:
Don't take softnet_lock in sysctl_rtable

Taking softnet_lock there can cause a locking error with nfs sosend, so we don't.
Having only KERNEL_LOCK is enough because now the routing table is protected by
KERNEL_LOCK that was introduced by the fix for PR 53043.

PR kern/54227 from Paul Ripke

diffstat:

 sys/net/rtsock.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 8a62dc1ca46f -r f53c94e84169 sys/net/rtsock.c
--- a/sys/net/rtsock.c  Mon May 27 03:08:13 2019 +0000
+++ b/sys/net/rtsock.c  Mon May 27 05:33:48 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtsock.c,v 1.249 2019/04/29 05:42:09 pgoyette Exp $    */
+/*     $NetBSD: rtsock.c,v 1.250 2019/05/27 05:33:48 ozaki-r Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.249 2019/04/29 05:42:09 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.250 2019/05/27 05:33:48 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -431,7 +431,7 @@
        w.w_needed = 0 - w.w_given;
        w.w_where = where;
 
-       SOFTNET_KERNEL_LOCK_UNLESS_NET_MPSAFE();
+       KERNEL_LOCK_UNLESS_NET_MPSAFE();
        s = splsoftnet();
        switch (w.w_op) {
 
@@ -478,7 +478,7 @@
                break;
        }
        splx(s);
-       SOFTNET_KERNEL_UNLOCK_UNLESS_NET_MPSAFE();
+       KERNEL_UNLOCK_UNLESS_NET_MPSAFE();
 
        /* check to see if we couldn't allocate memory with NOWAIT */
        if (error == ENOBUFS && w.w_tmem == 0 && w.w_tmemneeded)



Home | Main Index | Thread Index | Old Index