summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-05-17 08:59:05 +0000
committermpi <mpi@openbsd.org>2017-05-17 08:59:05 +0000
commit60cb7fecf691562b528b6b284809c3fac6672530 (patch)
tree59bda3a0805118eef9b1b4f267fa0a2f7c17a8c3
parentRaise "uvm_map_entry_kmem_pool" IPL level to IPL_VM to prevent a deadlock. (diff)
downloadwireguard-openbsd-60cb7fecf691562b528b6b284809c3fac6672530.tar.xz
wireguard-openbsd-60cb7fecf691562b528b6b284809c3fac6672530.zip
Remove useless splsoftnet().
Outside of USB, no code is executed in a softnet interrupt context. So what's protecting NFS data structures is the KERNEL_LOCK(). But more importantly, since r1.114 of nfs_socket.c, the 'softnet' thread is no longer executing NFS code. ok visa@
-rw-r--r--sys/nfs/nfs_socket.c17
-rw-r--r--sys/nfs/nfs_syscalls.c14
-rw-r--r--sys/nfs/nfs_vfsops.c7
3 files changed, 8 insertions, 30 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index d6f31340a17..619951ba1d5 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.115 2017/05/08 09:11:20 mpi Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.116 2017/05/17 08:59:05 mpi Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -394,7 +394,7 @@ nfs_reconnect(struct nfsreq *rep)
{
struct nfsreq *rp;
struct nfsmount *nmp = rep->r_nmp;
- int s, error;
+ int error;
nfs_disconnect(nmp);
while ((error = nfs_connect(nmp, rep)) != 0) {
@@ -407,12 +407,10 @@ nfs_reconnect(struct nfsreq *rep)
* Loop through outstanding request list and fix up all requests
* on old socket.
*/
- s = splsoftnet();
TAILQ_FOREACH(rp, &nmp->nm_reqsq, r_chain) {
rp->r_flags |= R_MUSTRESEND;
rp->r_rexmit = 0;
}
- splx(s);
return (0);
}
@@ -737,7 +735,7 @@ nfs_reply(struct nfsreq *myrep)
struct mbuf *nam;
u_int32_t rxid, *tl, t1;
caddr_t cp2;
- int s, error;
+ int error;
/*
* Loop around until we get our own reply
@@ -790,7 +788,6 @@ nfsmout:
* Loop through the request list to match up the reply
* Iff no match, just drop the datagram
*/
- s = splsoftnet();
TAILQ_FOREACH(rep, &nmp->nm_reqsq, r_chain) {
if (rep->r_mrep == NULL && rxid == rep->r_xid) {
/* Found it.. */
@@ -820,7 +817,6 @@ nfsmout:
break;
}
}
- splx(s);
/*
* If not matched to a request, drop it.
* If it's mine, get out.
@@ -854,7 +850,7 @@ nfs_request(struct vnode *vp, int procnum, struct nfsm_info *infop)
struct nfsmount *nmp;
struct timeval tv;
caddr_t cp2;
- int t1, i, s, error = 0;
+ int t1, i, error = 0;
int trylater_delay;
struct nfsreq *rep;
int mrest_len;
@@ -911,7 +907,6 @@ tryagain:
* Chain request into list of outstanding requests. Be sure
* to put it LAST so timer finds oldest requests first.
*/
- s = splsoftnet();
if (TAILQ_EMPTY(&nmp->nm_reqsq))
timeout_add(&nmp->nm_rtimeout, nfs_ticks);
TAILQ_INSERT_TAIL(&nmp->nm_reqsq, rep, r_chain);
@@ -924,7 +919,6 @@ tryagain:
if (nmp->nm_so && (nmp->nm_sotype != SOCK_DGRAM ||
(nmp->nm_flag & NFSMNT_DUMBTIMR) ||
nmp->nm_sent < nmp->nm_cwnd)) {
- splx(s);
if (nmp->nm_soflags & PR_CONNREQUIRED)
error = nfs_sndlock(&nmp->nm_flag, rep);
if (!error) {
@@ -939,7 +933,6 @@ tryagain:
rep->r_flags |= R_SENT;
}
} else {
- splx(s);
rep->r_rtt = -1;
}
@@ -952,11 +945,9 @@ tryagain:
/*
* RPC done, unlink the request.
*/
- s = splsoftnet();
TAILQ_REMOVE(&nmp->nm_reqsq, rep, r_chain);
if (TAILQ_EMPTY(&nmp->nm_reqsq))
timeout_del(&nmp->nm_rtimeout);
- splx(s);
/*
* Decrement the outstanding request count.
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index 54e6b348952..5d9aa6e4b5d 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.107 2017/02/22 11:42:46 mpi Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.108 2017/05/17 08:59:05 mpi Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -229,7 +229,7 @@ nfssvc_addsock(struct file *fp, struct mbuf *mynam)
struct nfssvc_sock *slp;
struct socket *so;
struct nfssvc_sock *tslp;
- int error, s;
+ int error;
so = (struct socket *)fp->f_data;
tslp = NULL;
@@ -286,12 +286,10 @@ nfssvc_addsock(struct file *fp, struct mbuf *mynam)
slp->ns_nam = mynam;
fp->f_count++;
slp->ns_fp = fp;
- s = splsoftnet();
so->so_upcallarg = (caddr_t)slp;
so->so_upcall = nfsrv_rcv;
slp->ns_flag = (SLP_VALID | SLP_NEEDQ);
nfsrv_wakenfsd(slp);
- splx(s);
return (0);
}
@@ -309,11 +307,10 @@ nfssvc_nfsd(struct nfsd *nfsd)
int *solockp;
struct nfsrv_descript *nd = NULL;
struct mbuf *mreq;
- int error = 0, cacherep, s, sotype;
+ int error = 0, cacherep, sotype;
cacherep = RC_DOIT;
- s = splsoftnet();
TAILQ_INSERT_TAIL(&nfsd_head, nfsd, nfsd_chain);
nfs_numnfsd++;
@@ -357,8 +354,6 @@ loop:
goto loop;
}
- splx(s);
-
so = slp->ns_so;
sotype = so->so_type;
if (ISSET(so->so_proto->pr_flags, PR_CONNREQUIRED))
@@ -434,7 +429,6 @@ loop:
if (error == EINTR || error == ERESTART) {
pool_put(&nfsrv_descript_pl, nd);
nfsrv_slpderef(slp);
- s = splsoftnet();
goto done;
}
break;
@@ -449,7 +443,6 @@ loop:
nd = NULL;
}
- s = splsoftnet();
if (nfsrv_dorec(slp, nfsd, &nd)) {
nfsd->nfsd_flag &= ~NFSD_REQINPROG;
nfsd->nfsd_slp = NULL;
@@ -459,7 +452,6 @@ loop:
done:
TAILQ_REMOVE(&nfsd_head, nfsd, nfsd_chain);
- splx(s);
free(nfsd, M_NFSD, sizeof(*nfsd));
if (--nfs_numnfsd == 0)
nfsrv_init(1); /* Reinitialize everything */
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index edb965af3fa..7a7c5a1cbdc 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vfsops.c,v 1.113 2017/02/22 11:42:46 mpi Exp $ */
+/* $OpenBSD: nfs_vfsops.c,v 1.114 2017/05/17 08:59:05 mpi Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */
/*
@@ -403,12 +403,9 @@ void
nfs_decode_args(struct nfsmount *nmp, struct nfs_args *argp,
struct nfs_args *nargp)
{
- int s;
int adjsock = 0;
int maxio;
- s = splsoftnet();
-
#if 0
/* Re-bind if rsrvd port requested and wasn't on one */
adjsock = !(nmp->nm_flag & NFSMNT_RESVPORT)
@@ -418,10 +415,8 @@ nfs_decode_args(struct nfsmount *nmp, struct nfs_args *argp,
adjsock |= ((nmp->nm_flag & NFSMNT_NOCONN) !=
(argp->flags & NFSMNT_NOCONN));
- /* Update flags atomically. Don't change the lock bits. */
nmp->nm_flag =
(argp->flags & ~NFSMNT_INTERNAL) | (nmp->nm_flag & NFSMNT_INTERNAL);
- splx(s);
if ((argp->flags & NFSMNT_TIMEO) && argp->timeo > 0) {
nmp->nm_timeo = (argp->timeo * NFS_HZ + 5) / 10;