Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 May 2011 14:34:22 +0200
From:      Goran Lowkrantz <glz@hidden-powers.com>
To:        freebsd-current@freebsd.org
Cc:        Rick Macklem <rmacklem@uoguelph.ca>
Subject:   Re: Testing new nfs and VIMAGE
Message-ID:  <1DE98FADA8318788A5DD5505@[172.16.2.57]>
In-Reply-To: <40413420.946642.1306625323806.JavaMail.root@erie.cs.uoguelph.ca>
References:  <40413420.946642.1306625323806.JavaMail.root@erie.cs.uoguelph.ca>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
For the list: Attached patch works.

/glz

--On May 28, 2011 19:28:43 -0400 Rick Macklem <rmacklem@uoguelph.ca> 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


[-- Attachment #2 --]
--- 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);
help

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