For the list: Attached patch works.

/glz

--On May 28, 2011 19:28:43 -0400 Rick Macklem <[email protected]> wrote:

It worked when I added CURVNET_SET/CURVNET_RESTORE around the
RTFREE_LOCKED
macro too. Attached a complete patch.

Thank you.

and thanks for finding/reporting/testing it. I've attached another
variant of the patch that maybe you could try?
(I don't think it's necessary to do twice, so I just moved the
 CURVNET_RESTORE() to after the RTFREE_LOCKED() macro instead.)

I don't know if you are a committer for this stuff or not?
If you are feel free to commit whichever variant of the patch you
find works and prefer.

If not, maybe bz@ could either commit it or review it?
(or whoever is doing the VIMAGE stuff these days?)

rick

--- fs/nfsclient/nfs_clport.c.sav	2011-05-04 19:12:10.000000000 -0400
+++ fs/nfsclient/nfs_clport.c	2011-05-28 19:14:30.000000000 -0400
@@ -943,6 +943,7 @@ nfscl_getmyip(struct nfsmount *nmp, int 
 		sad.sin_family = AF_INET;
 		sad.sin_len = sizeof (struct sockaddr_in);
 		sad.sin_addr.s_addr = sin->sin_addr.s_addr;
+		CURVNET_SET(TD_TO_VNET(curthread));
 		rt = rtalloc1((struct sockaddr *)&sad, 0, 0UL);
 		if (rt != NULL) {
 			if (rt->rt_ifp != NULL &&
@@ -956,6 +957,7 @@ nfscl_getmyip(struct nfsmount *nmp, int 
 			}
 			RTFREE_LOCKED(rt);
 		}
+		CURVNET_RESTORE();
 #ifdef INET6
 	} else if (nmp->nm_nam->sa_family == AF_INET6) {
 		struct sockaddr_in6 sad6, *sin6;
@@ -966,6 +968,7 @@ nfscl_getmyip(struct nfsmount *nmp, int 
 		sad6.sin6_family = AF_INET6;
 		sad6.sin6_len = sizeof (struct sockaddr_in6);
 		sad6.sin6_addr = sin6->sin6_addr;
+		CURVNET_SET(TD_TO_VNET(curthread));
 		rt = rtalloc1((struct sockaddr *)&sad6, 0, 0UL);
 		if (rt != NULL) {
 			if (rt->rt_ifp != NULL &&
@@ -980,6 +983,7 @@ nfscl_getmyip(struct nfsmount *nmp, int 
 			}
 			RTFREE_LOCKED(rt);
 		}
+		CURVNET_RESTORE();
 #endif
 	}
 	return (retp);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[email protected]"

Reply via email to