From owner-svn-src-all@freebsd.org Fri Jul 28 18:09:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69731DCB2E7; Fri, 28 Jul 2017 18:09:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3845F6A656; Fri, 28 Jul 2017 18:09:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SI9f29097175; Fri, 28 Jul 2017 18:09:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SI9fYo097174; Fri, 28 Jul 2017 18:09:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201707281809.v6SI9fYo097174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 28 Jul 2017 18:09:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321657 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 321657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jul 2017 18:09:42 -0000 Author: jhb Date: Fri Jul 28 18:09:41 2017 New Revision: 321657 URL: https://svnweb.freebsd.org/changeset/base/321657 Log: MFC 321075: Set the current vnet pointer in the socket buffer AIO handler. This fixes panics when using AIO under VIMAGE. Sponsored by: Chelsio Communications Modified: stable/11/sys/kern/sys_socket.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/sys_socket.c ============================================================================== --- stable/11/sys/kern/sys_socket.c Fri Jul 28 17:45:20 2017 (r321656) +++ stable/11/sys/kern/sys_socket.c Fri Jul 28 18:09:41 2017 (r321657) @@ -675,6 +675,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); @@ -698,6 +699,7 @@ soaio_process_sb(struct socket *so, struct sockbuf *sb ACCEPT_LOCK(); SOCK_LOCK(so); sorele(so); + CURVNET_RESTORE(); } void