From owner-freebsd-current@FreeBSD.ORG Sat May 28 13:35:53 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EA8E1065672 for ; Sat, 28 May 2011 13:35:53 +0000 (UTC) (envelope-from glz@hidden-powers.com) Received: from mail.hidden-powers.com (mail.hidden-powers.com [213.242.135.162]) by mx1.freebsd.org (Postfix) with ESMTP id C84888FC0C for ; Sat, 28 May 2011 13:35:52 +0000 (UTC) Received: from mail.hidden-powers.com (localhost [127.0.0.1]) by dkim.hidden-powers.com (Postfix) with ESMTP id 8A2486F042; Sat, 28 May 2011 15:35:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=hidden-powers.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; s=selector1; bh=M3xnBRs9LS7g4fac4xeO vwG3jgQ=; b=hjCiiwFJpRBC2DdYh/tlvKw1Yj3Z0MrnqrCFX74qRwKfzUVjAj0B 79W1VODKbTTL7S8oNm4jWvfVOniS/sASYQq6N66aGuYsR+6GBI9J0ReMFEzWDehn MwdIebBsCC4tEx6aLwRPHLbtgRIhEatRexBjtfKeUZgBnfV+m/ZwlUM= Received: from [10.255.253.2] (unknown [10.255.253.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.hidden-powers.com (Postfix) with ESMTPSA id 7B6D36F041; Sat, 28 May 2011 15:35:50 +0200 (CEST) Date: Sat, 28 May 2011 15:35:50 +0200 From: Goran Lowkrantz To: Rick Macklem Message-ID: In-Reply-To: <1297732809.928917.1306537388344.JavaMail.root@erie.cs.uoguelph.ca> References: <1297732809.928917.1306537388344.JavaMail.root@erie.cs.uoguelph.ca> X-Mailer: Mulberry/4.0.8 (Win32) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="==========8EBC387DA9AF1CC8AF09==========" Cc: freebsd-current@freebsd.org Subject: Re: Testing new nfs and VIMAGE X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 13:35:53 -0000 --==========8EBC387DA9AF1CC8AF09========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline --On Friday, May 27, 2011 7:03 PM -0400 Rick Macklem wrote: >> And the attached core.txt got eaten. >> >> >> /glz >> >> --On May 27, 2011 10:37:32 +0200 Goran Lowkrantz >> >> wrote: >> >> > >> > I have been testing VIMAGE a lot lately to see how it works an all >> > my >> > test cases works as expected except when I use NFSv4 from an NFS >> > client >> > with a kerrel with VIMAGE enabled. >> > >> > All other permutations work and this error is very specific. All >> > crashes >> > occurs when trying to read or write to an NFS v4 volume. I have seen >> > it >> > on both i386 and amd64. >> > >> ># 12 0xc0a73c15 in rt_tables_get_rnh (table=0, fam=2) >> > at /usr/src/sys/net/route.c:153 >> > >> > >> > static __inline struct radix_node_head ** >> > rt_tables_get_rnh_ptr(int table, int fam) >> > { >> > struct radix_node_head **rnh; >> > >> > KASSERT(table >= 0 && table < rt_numfibs, ("%s: table out of >> > bounds.", >> > __func__)); >> > KASSERT(fam >= 0 && fam < (AF_MAX+1), ("%s: fam out of >> > bounds.", >> > __func__)); >> > >> > /* rnh is [fib=0][af=0]. */ >> > ---> rnh = (struct radix_node_head **)V_rt_tables; >> > /* Get the offset to the requested table and fam. */ >> > rnh += table * (AF_MAX+1) + fam; >> > >> > return (rnh); >> > } >> > >> > Any ideas? >> > >> > Cores and dumps are available plus a vmware player setup to test and >> > debug. >> > > I know diddly about VIMAGE, but you could try the attached patch which > imitates what is done other places. > > If the patch isn't attached, you can find it at: > http://people.freebsd.org/~rmacklem/vnet.patch > > rick It worked when I added CURVNET_SET/CURVNET_RESTORE around the RTFREE_LOCKED macro too. Attached a complete patch. Thank you. /glz --==========8EBC387DA9AF1CC8AF09========== Content-Type: text/x-patch; charset=us-ascii; name="vnet.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="vnet.patch"; size=1406 --- fs/nfsclient/nfs_clport.c.orig 2011-05-19 03:35:52.000000000 +0200 +++ fs/nfsclient/nfs_clport.c 2011-05-28 11:03:16.563178326 +0200 @@ -943,7 +943,9 @@ 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); + CURVNET_RESTORE(); if (rt != NULL) { if (rt->rt_ifp != NULL && rt->rt_ifa != NULL && @@ -954,7 +956,9 @@ nfscl_getmyip(struct nfsmount *nmp, int laddr.s_addr = sin->sin_addr.s_addr; retp = (u_int8_t *)&laddr; } + CURVNET_SET(TD_TO_VNET(curthread)); RTFREE_LOCKED(rt); + CURVNET_RESTORE(); } #ifdef INET6 } else if (nmp->nm_nam->sa_family == AF_INET6) { @@ -966,7 +970,9 @@ 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); + CURVNET_RESTORE(); if (rt != NULL) { if (rt->rt_ifp != NULL && rt->rt_ifa != NULL && @@ -978,7 +984,9 @@ nfscl_getmyip(struct nfsmount *nmp, int retp = (u_int8_t *)&laddr6; *isinet6p = 1; } + CURVNET_SET(TD_TO_VNET(curthread)); RTFREE_LOCKED(rt); + CURVNET_RESTORE(); } #endif } --==========8EBC387DA9AF1CC8AF09==========--