Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 May 2007 14:48:58 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 119335 for review
Message-ID:  <200705061448.l46EmwPX024574@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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