From owner-svn-src-stable@FreeBSD.ORG Mon Aug 31 09:46:10 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 600A81065679; Mon, 31 Aug 2009 09:46:10 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44AC58FC14; Mon, 31 Aug 2009 09:46:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7V9kADG022783; Mon, 31 Aug 2009 09:46:10 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7V9kAYN022780; Mon, 31 Aug 2009 09:46:10 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200908310946.n7V9kAYN022780@svn.freebsd.org> From: Marko Zec Date: Mon, 31 Aug 2009 09:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196691 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris compat/linprocfs compat/linux contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2009 09:46:10 -0000 Author: zec Date: Mon Aug 31 09:46:09 2009 New Revision: 196691 URL: http://svn.freebsd.org/changeset/base/196691 Log: MFC r196635: Fix a few panics in linuxulator + VIMAGE due to curvnet not being set. This change affects only options VIMAGE builds. Reviewed by: julian Approved by: re (rwatson) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/linprocfs/linprocfs.c stable/8/sys/compat/linux/linux_ioctl.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/8/sys/compat/linprocfs/linprocfs.c Mon Aug 31 09:44:07 2009 (r196690) +++ stable/8/sys/compat/linprocfs/linprocfs.c Mon Aug 31 09:46:09 2009 (r196691) @@ -1085,6 +1085,7 @@ linprocfs_donetdev(PFS_FILL_ARGS) "bytes packets errs drop fifo frame compressed", "bytes packets errs drop fifo frame compressed"); + CURVNET_SET(TD_TO_VNET(curthread)); IFNET_RLOCK(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { linux_ifname(ifp, ifname, sizeof ifname); @@ -1095,6 +1096,7 @@ linprocfs_donetdev(PFS_FILL_ARGS) 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL); } IFNET_RUNLOCK(); + CURVNET_RESTORE(); return (0); } Modified: stable/8/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/8/sys/compat/linux/linux_ioctl.c Mon Aug 31 09:44:07 2009 (r196690) +++ stable/8/sys/compat/linux/linux_ioctl.c Mon Aug 31 09:46:09 2009 (r196691) @@ -2104,6 +2104,7 @@ ifname_linux_to_bsd(struct thread *td, c return (NULL); index = 0; is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0; + CURVNET_SET(TD_TO_VNET(td)); IFNET_RLOCK(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { /* @@ -2117,6 +2118,7 @@ ifname_linux_to_bsd(struct thread *td, c break; } IFNET_RUNLOCK(); + CURVNET_RESTORE(); if (ifp != NULL) strlcpy(bsdname, ifp->if_xname, IFNAMSIZ); return (ifp); @@ -2146,6 +2148,7 @@ linux_ifconf(struct thread *td, struct i max_len = MAXPHYS - 1; + CURVNET_SET(TD_TO_VNET(td)); /* handle the 'request buffer size' case */ if (ifc.ifc_buf == PTROUT(NULL)) { ifc.ifc_len = 0; @@ -2157,11 +2160,14 @@ linux_ifconf(struct thread *td, struct i } } error = copyout(&ifc, uifc, sizeof(ifc)); + CURVNET_RESTORE(); return (error); } - if (ifc.ifc_len <= 0) + if (ifc.ifc_len <= 0) { + CURVNET_RESTORE(); return (EINVAL); + } again: /* Keep track of eth interfaces */ @@ -2223,6 +2229,7 @@ again: memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); + CURVNET_RESTORE(); return (error); }