From owner-freebsd-hackers Tue Jun 15 14:39:18 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (Postfix) with ESMTP id 710F914C2E; Tue, 15 Jun 1999 14:39:13 -0700 (PDT) (envelope-from julian@whistle.com) Received: from current1.whistle.com (current1.whistle.com [207.76.205.22]) by alpo.whistle.com (8.9.1a/8.9.1) with SMTP id OAA61487; Tue, 15 Jun 1999 14:39:02 -0700 (PDT) Date: Tue, 15 Jun 1999 14:39:00 -0700 (PDT) From: Julian Elischer To: Matthew Dillon Cc: Matthew Jacob , Guido van Rooij , freebsd-hackers@FreeBSD.ORG, peter@FreeBSD.ORG Subject: Re: Holy cow - path component freeing a mess? (was Re: D'oh!) In-Reply-To: <199906152055.NAA20771@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG talk to terry on this topic :-) He has a set of patches that straighten all this out julian On Tue, 15 Jun 1999, Matthew Dillon wrote: > This is totally screwed up: The rules used to determine whether > a path component buffer ( struct componentname, sys/namei.h ) is freed > by a VOP routine or not are idiotic. > > As far as I can tell, the rule is: > > * if no error is returned free the path component buffer, but only > if the SAVESTART flag is not set. > > * If an error is returned, free the path component buffer whether > SAVESTART is set or not. > > Combine this with the callers which decide whether to set SAVESTART, > and the result is an extremely fragile mess. Combine this with > VOP_ABORTOP's operation ( which frees the path component if SAVESTART is > not set ) and it gets even worse. > > Confused yet? > > At the very least, anyone who zfree's a path component should > clear the HASBUF flag so sanity checks can be added to the code. The > nfs_serv.c code is unnecessarily complex due to this junkiness. > > I would like to fix this in the tree and add sanity checks. > > -Matt > Matthew Dillon > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message