aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/accf_http.c
diff options
context:
space:
mode:
authorSeigo Tanimura <tanimura@FreeBSD.org>2002-04-27 08:24:29 +0000
committerSeigo Tanimura <tanimura@FreeBSD.org>2002-04-27 08:24:29 +0000
commitd48d4b2501ae630314107a3b5c1cd442616cad6f (patch)
tree982f8e96f9de9e219deaa4ea138a8334dc086c3c /sys/netinet/accf_http.c
parentf5d157fb5100a6cc0944cf56b11fa53ef1757d30 (diff)
downloadsrc-d48d4b2501ae630314107a3b5c1cd442616cad6f.tar.gz
src-d48d4b2501ae630314107a3b5c1cd442616cad6f.zip
Add a global sx sigio_lock to protect the pointer to the sigio object
of a socket. This avoids lock order reversal caused by locking a process in pgsigio(). sowakeup() and the callers of it (sowwakeup, soisconnected, etc.) now require sigio_lock to be locked. Provide sowwakeup_locked(), soisconnected_locked(), and so on in case where we have to modify a socket and wake up a process atomically.
Notes
Notes: svn path=/head/; revision=95552
Diffstat (limited to 'sys/netinet/accf_http.c')
-rw-r--r--sys/netinet/accf_http.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netinet/accf_http.c b/sys/netinet/accf_http.c
index a9a8fb032b32..73c9af2f3075 100644
--- a/sys/netinet/accf_http.c
+++ b/sys/netinet/accf_http.c
@@ -197,9 +197,11 @@ sohashttpget(struct socket *so, void *arg, int waitflag)
fallout:
DPRINT("fallout");
+ SIGIO_SLOCK();
so->so_upcall = NULL;
so->so_rcv.sb_flags &= ~SB_UPCALL;
- soisconnected(so);
+ soisconnected_locked(so);
+ SIGIO_SUNLOCK();
return;
}
@@ -269,9 +271,11 @@ readmore:
fallout:
DPRINT("fallout");
+ SIGIO_SLOCK();
so->so_upcall = NULL;
so->so_rcv.sb_flags &= ~SB_UPCALL;
- soisconnected(so);
+ soisconnected_locked(so);
+ SIGIO_SUNLOCK();
return;
}
@@ -339,8 +343,10 @@ readmore:
return;
gotit:
+ SIGIO_SLOCK();
so->so_upcall = NULL;
so->so_rcv.sb_flags &= ~SB_UPCALL;
- soisconnected(so);
+ soisconnected_locked(so);
+ SIGIO_SUNLOCK();
return;
}