From owner-p4-projects@FreeBSD.ORG Sun May 6 14:48:58 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A9D4316A404; Sun, 6 May 2007 14:48:58 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 804B616A402 for ; Sun, 6 May 2007 14:48:58 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 713B513C4C1 for ; Sun, 6 May 2007 14:48:58 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l46EmwXX024577 for ; Sun, 6 May 2007 14:48:58 GMT (envelope-from zec@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l46EmwPX024574 for perforce@freebsd.org; Sun, 6 May 2007 14:48:58 GMT (envelope-from zec@FreeBSD.org) Date: Sun, 6 May 2007 14:48:58 GMT Message-Id: <200705061448.l46EmwPX024574@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@FreeBSD.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 119335 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2007 14:48:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=119335 Change 119335 by zec@zec_zoo on 2007/05/06 14:47:58 Using INIT_VNET_*() macros with curvnet not set leads to a panic, which is IMO a usefull consistency check. Hence, set / restore curvnet appropriately in nfs_create(). Affected files ... .. //depot/projects/vimage/src/sys/nfsclient/nfs_vnops.c#7 edit Differences ... ==== //depot/projects/vimage/src/sys/nfsclient/nfs_vnops.c#7 (text+ko) ==== @@ -1390,16 +1390,18 @@ if (v3) { tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED); if (fmode & O_EXCL) { + CURVNET_SET(VFSTONFS(dvp->v_mount)->nm_so->so_vnet); *tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE); tl = nfsm_build(u_int32_t *, NFSX_V3CREATEVERF); #ifdef INET - INIT_VNET_INET(VFSTONFS(dvp->v_mount)->nm_so->so_vnet); + INIT_VNET_INET(curvnet); if (!TAILQ_EMPTY(&V_in_ifaddrhead)) *tl++ = IA_SIN(TAILQ_FIRST(&V_in_ifaddrhead))->sin_addr.s_addr; else #endif *tl++ = create_verf; *tl = ++create_verf; + CURVNET_RESTORE(); } else { *tl = txdr_unsigned(NFSV3CREATE_UNCHECKED); nfsm_v3attrbuild(vap, FALSE);