Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144631950
D49814.1775896867.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
850 B
Referenced Files
None
Subscribers
None
D49814.1775896867.diff
View Options
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1742,6 +1742,8 @@
/*
* Transfer any data already present in the socket buffer.
*/
+ KASSERT(sp->state == SPLICE_INIT,
+ ("so_splice: splice %p state %d", sp, sp->state));
sp->state = SPLICE_QUEUED;
so_splice_xfer(sp);
return (0);
@@ -1770,8 +1772,19 @@
SOCK_UNLOCK(so);
return (ENOTCONN);
}
- so->so_rcv.sb_flags &= ~SB_SPLICED;
sp = so->so_splice;
+ mtx_lock(&sp->mtx);
+ if (sp->state == SPLICE_INIT) {
+ /*
+ * A splice is in the middle of being set up.
+ */
+ mtx_unlock(&sp->mtx);
+ SOCK_RECVBUF_UNLOCK(so);
+ SOCK_UNLOCK(so);
+ return (ENOTCONN);
+ }
+ mtx_unlock(&sp->mtx);
+ so->so_rcv.sb_flags &= ~SB_SPLICED;
so->so_splice = NULL;
SOCK_RECVBUF_UNLOCK(so);
SOCK_UNLOCK(so);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 11, 8:41 AM (3 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28322034
Default Alt Text
D49814.1775896867.diff (850 B)
Attached To
Mode
D49814: so_splice: Synchronize so_unsplice() with so_splice()
Attached
Detach File
Event Timeline
Log In to Comment