Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jul 2017 16:59:22 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321075 - head/sys/kern
Message-ID:  <201707171659.v6HGxMFc048775@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Mon Jul 17 16:59:22 2017
New Revision: 321075
URL: https://svnweb.freebsd.org/changeset/base/321075

Log:
  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

Modified:
  head/sys/kern/sys_socket.c

Modified: head/sys/kern/sys_socket.c
==============================================================================
--- head/sys/kern/sys_socket.c	Mon Jul 17 14:09:34 2017	(r321074)
+++ head/sys/kern/sys_socket.c	Mon Jul 17 16:59:22 2017	(r321075)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707171659.v6HGxMFc048775>