Page MenuHomeFreeBSD

D49814.id.diff
No OneTemporary

D49814.id.diff

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

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)

Event Timeline