On Tue, Sep 20, 2016 at 08:21:55AM -0400, David Hill wrote:
> With bluhm's r1.160 uipc_socket.c.

With splsoftnet() in soshutdown() I can fix this one.

splassert: sowwakeup: want 5 have 0
Starting stack trace...
splassert_check() at splassert_check+0x78
sowwakeup() at sowwakeup+0x27
uipc_usrreq() at uipc_usrreq+0xfd
sys_shutdown() at sys_shutdown+0x67
syscall() at syscall+0x27b
--- syscall (number 134) ---
end of kernel
end trace frame: 0xe8f2cba5e80, count: 252
0xe8f305dc16a:
End of stack trace.

ok?

bluhm

Index: kern/uipc_socket.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/kern/uipc_socket.c,v
retrieving revision 1.160
diff -u -p -r1.160 uipc_socket.c
--- kern/uipc_socket.c  20 Sep 2016 11:11:44 -0000      1.160
+++ kern/uipc_socket.c  20 Sep 2016 13:43:19 -0000
@@ -1018,20 +1018,26 @@ int
 soshutdown(struct socket *so, int how)
 {
        struct protosw *pr = so->so_proto;
+       int s, error = 0;
 
+       s = splsoftnet();
        switch (how) {
        case SHUT_RD:
        case SHUT_RDWR:
                sorflush(so);
                if (how == SHUT_RD)
-                       return (0);
+                       break;
                /* FALLTHROUGH */
        case SHUT_WR:
-               return (*pr->pr_usrreq)(so, PRU_SHUTDOWN, NULL, NULL, NULL,
+               error = (*pr->pr_usrreq)(so, PRU_SHUTDOWN, NULL, NULL, NULL,
                    curproc);
+               break;
        default:
-               return (EINVAL);
+               error = EINVAL;
+               break;
        }
+       splx(s);
+       return (error);
 }
 
 void

Reply via email to