From owner-freebsd-net@FreeBSD.ORG Thu Dec 9 15:19:14 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B07916A4CE for ; Thu, 9 Dec 2004 15:19:14 +0000 (GMT) Received: from manian.sics.se (manian.sics.se [193.10.66.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCC5043D6E for ; Thu, 9 Dec 2004 15:19:13 +0000 (GMT) (envelope-from bg@sics.se) Received: from manian.sics.se (localhost [127.0.0.1]) by manian.sics.se (8.13.1/8.13.1) with SMTP id iB9FIt3i004135; Thu, 9 Dec 2004 16:18:55 +0100 (CET) (envelope-from bg@sics.se) Date: Thu, 9 Dec 2004 16:18:55 +0100 From: =?ISO-8859-1?Q?Bj=F6rn_Gr=F6nvall?= To: Bruce M Simpson , alfred@FreeBSD.org Message-ID: <20041209161855.30952220@manian.sics.se> In-Reply-To: <20041125215225.GF733@empiric.icir.org> References: <20041125201812.609e50f9@manian.sics.se> <20041125215225.GF733@empiric.icir.org> Organization: SICS X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i386-portbld-freebsd5.3) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit cc: lennox@cs.columbia.edu cc: freebsd-net@FreeBSD.org cc: kris@FreeBSD.org cc: dnelson@allantgroup.com Subject: Re: Linux compatible rpc.lockd X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2004 15:19:14 -0000 On Thu, 25 Nov 2004 13:52:25 -0800 Bruce M Simpson wrote: Hi all, > On Thu, Nov 25, 2004 at 08:18:12PM +0100, Björn Grönvall wrote: > > I have made a patch to address PR kern/56461, in short the patch > > provides two different options to be compatible with Linux lockd > > implementations. It can also serve as a basis for a future more robust > > rpc.lockd. > > Thank you for this. I looked at this around 8 months ago but abandoned > further work on it because the approach I was taking required that > nfs be refactored to use the nmount() API, and because I am not currently > using NFS. It looks as though the two options implemented here helps to > address the problems I was having with making sure Linux servers got > the right lock cookie response. > > Have you tested this in production and does it work well? If so I believe > it should be committed, but I'd defer to Alfred for further review. I now believe that the patch has been tested enough. Its been running on a rather busy fileserver for almost 3 weeks now and we have observed no problems this far. To ensure that rpc.lockd works correctly on 64 bit machines I think this patch should also be applied. Cheers, Björn --- kern.c~ Thu Nov 25 19:43:44 2004 +++ kern.c Fri Nov 26 14:16:17 2004 @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -290,6 +291,12 @@ } res; int cookie_len; + /* union XXX */ + assert((void *)&res.res.cookie == &res.res4.cookie); + assert((void *)&res.res.stat.stat == &res.res4.stat.stat); + assert((void *)&res.res.stat.nlm_testrply_u.holder.svid == + &res.res4.stat.nlm4_testrply_u.holder.svid); + if (asynchronous_client_rpc) cookie_len = client_cookie_len; /* Long cookies */ else @@ -388,6 +395,10 @@ } res; int cookie_len; + /* union XXX */ + assert((void *)&res.res.cookie == &res.res4.cookie); + assert((void *)&res.res.stat.stat == &res.res4.stat.stat); + if (asynchronous_client_rpc) cookie_len = client_cookie_len; /* Long cookies */ else @@ -493,6 +504,10 @@ } res; int cookie_len; + /* union XXX */ + assert((void *)&res.res.cookie == &res.res4.cookie); + assert((void *)&res.res.stat.stat == &res.res4.stat.stat); + if (asynchronous_client_rpc) cookie_len = client_cookie_len; /* Long cookies */ else @@ -560,7 +575,7 @@ } else { touch_client(cli); lock_answer(msg->lm_msg_ident.pid, - &res.res.cookie, + &res.res.cookie, /* union XXX */ res.res.stat.stat, NULL, nlm_version); -- _ _ ,_______________. Bjorn Gronvall (Björn Grönvall) /_______________/| Swedish Institute of Computer Science | || PO Box 1263, S-164 29 Kista, Sweden | Schroedingers || Email: bg@sics.se, Phone +46 -8 633 15 25 | Cat |/ Cellular +46 -70 768 06 35, Fax +46 -8 751 72 30 '---------------'