Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151296462
D49814.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
850 B
Referenced Files
None
Subscribers
None
D49814.id.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
Wed, Apr 8, 9:54 AM (21 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31093021
Default Alt Text
D49814.id.diff (850 B)
Attached To
Mode
D49814: so_splice: Synchronize so_unsplice() with so_splice()
Attached
Detach File
Event Timeline
Log In to Comment