From owner-cvs-all Tue Oct 23 15: 2:25 2001 Delivered-To: cvs-all@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 6E09837B401; Tue, 23 Oct 2001 15:02:18 -0700 (PDT) Received: by elvis.mu.org (Postfix, from userid 1192) id 6E35681D08; Tue, 23 Oct 2001 17:02:18 -0500 (CDT) Date: Tue, 23 Oct 2001 17:02:18 -0500 From: Alfred Perlstein To: Robert Watson Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern vfs_vnops.c Message-ID: <20011023170218.Q15052@elvis.mu.org> References: <200110231909.f9NJ91q65339@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: <200110231909.f9NJ91q65339@freefall.freebsd.org>; from rwatson@FreeBSD.org on Tue, Oct 23, 2001 at 12:09:01PM -0700 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Robert Watson [011023 14:09] wrote: > rwatson 2001/10/23 12:09:01 PDT > > Modified files: > sys/kern vfs_vnops.c > Log: > o vn_open() fails to call VOP_CLOSE() if vfs_object_create fails. Ideally > all successful calls to VOP_OPEN() might be reflected in a call to > VOP_CLOSE(). For now, simply add a comment reflecting this problem; > this should be fixed at some point. Actually, this looks like an honest to goodness fixable bug. If vfs_object_create() fails, then vn_open() will return an error indicating that the open failed, the caller will not know to call VOP_CLOSE(). From the manpage for VOP_CLOSE: VOP_CLOSE(9) expects at least a reference to be associated with the vnode and does not care whether the vnode is locked or not. The lock and ref­ erence state is left unchanged on return. Note that vn_close expects an unlocked, referenced vnode and will dereference the vnode prior to returning. Have you tried to simulate a failure from vfs_objectcreate to see if vn_open() can be sucessfully fixed? The manpage seems to indicate that all VOP_OPEN calls need VOP_CLOSE, in fact if I were an underlying filesystem I would be somewhat upset to see that sort of discrepenacy. -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' http://www.morons.org/rants/gpl-harmful.php3 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message