From owner-freebsd-current@FreeBSD.ORG Wed Jul 21 00:19:15 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B921A16A4CE; Wed, 21 Jul 2004 00:19:15 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D57143D5C; Wed, 21 Jul 2004 00:19:14 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.11/8.12.11) with ESMTP id i6L0Icu3012715; Tue, 20 Jul 2004 20:18:38 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i6L0IcUF012712; Tue, 20 Jul 2004 20:18:38 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Tue, 20 Jul 2004 20:18:38 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Frode Nordahl In-Reply-To: <297F948A-DAA5-11D8-B5B9-000A95A9A574@nordahl.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE cc: =?ISO-8859-1?Q?Bj=F6rn_Gr=F6nvall?= cc: re@freebsd.org cc: current@freebsd.org Subject: Re: 5.3-RELEASE TODO X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Wed, 21 Jul 2004 00:19:15 -0000 On Wed, 21 Jul 2004, Frode Nordahl wrote: > On Jul 16, 2004, at 11:17, Bj=F6rn Gr=F6nvall wrote: >=20 > > PR bin/61718 fixes a bunch of bugs in rpc.lockd, please try it. >=20 > Yes, rpc.lockd is useless without this patch. >=20 > Can someone please commit it? It looks like much if not all of it was committed on 20040716; commit message below. Are any specific things that appear to be missing that weren't merged? Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Principal Research Scientist, McAfee Research revision 1.17 date: 2004/07/16 12:50:10; author: mr; state: Exp; lines: +1 -1 After talking to Colin, apply the patch of bin/61718 (which should include/elimatate kern/61122 also). It seems to fix a few annoying bugs. PR: bin/61718, kern/61122 Submitted by: bg@sics.se ohartman@mail.physik.uni-mainz.de ---------------------------- revision 1.18 date: 2004/07/16 19:30:59; author: mr; state: Exp; lines: +0 -0 Forced commit to actually list the changes of bin/61718, as requested by sam. The attached patch fixes a number of problems present in rpc.lockd. 1) Nfslocklist_head.lf_first is overwritten because of an off-by-one-bug that happens when clnt_cache_next_to_use is incorrectly incremented. 2) 'struct sockaddr *addr' inside 'struct file_lock' is set to point to the result from svc_getrpccaller(). This value is malloc:ed inside the rpc libraries and is free:ed when clnt_destroy() is called. Fix, maintain a copy of the result. 3) The loop inside retry_blockingfilelocklist() that uses 3 pointers ifl, nfl, and pfl thrashes the list pointed to by blockedlocklist_head.lf_first. Fix, use a simpler loop. The new loop does not preserve list order but the order is immaterial anyways. See also revison 1.6-1.7 and kern/61122. 4) struct file_lock char client_name[SM_MAXSTRLEN]; and struct host char name[SM_MAXSTRLEN]; Be careful to not create open (non 0 terminated) C strings and later passing them to e.g syslog. Fix, make sure that the strings are always terminated with 0. When at it, move the strings to the end of the structs and make them variable length. This saves about 1000 bytes for every malloc:ed struct. 5) The newfl =3D malloc(sizeof(struct file_lock)) memory was never properly bzero:ed. Minor changes: A) Nlmtonlm4(0) made assumptions about struct layouts. B) Don't close stdout and stderr when debugging (-d option). C) Remove unused pid_t locker and int fd in struct file_lock. D) s/printf/debuglog/ E) Remove redundant sleep(1) and call to debuglog(). Cheers, Bjrn