From c7af7893607a9a1a42d7c4f6b4ac39517807bea3 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 17 Jul 2017 16:59:22 +0000 Subject: [PATCH] Set the current vnet pointer in the socket buffer AIO handler. This fixes panics when using AIO under VIMAGE. Reported by: kp MFC after: 3 days Sponsored by: Chelsio Communications --- sys/kern/sys_socket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 3e395106cecc..df74c4a7af4d 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -693,6 +693,7 @@ soaio_process_sb(struct socket *so, struct sockbuf *sb) { struct kaiocb *job; + CURVNET_SET(so->so_vnet); SOCKBUF_LOCK(sb); while (!TAILQ_EMPTY(&sb->sb_aiojobq) && soaio_ready(so, sb)) { job = TAILQ_FIRST(&sb->sb_aiojobq); @@ -715,6 +716,7 @@ soaio_process_sb(struct socket *so, struct sockbuf *sb) SOCK_LOCK(so); sorele(so); + CURVNET_RESTORE(); } void