Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Oct 2001 17:02:18 -0500
From:      Alfred Perlstein <bright@mu.org>
To:        Robert Watson <rwatson@FreeBSD.org>
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>
In-Reply-To: <200110231909.f9NJ91q65339@freefall.freebsd.org>; from rwatson@FreeBSD.org on Tue, Oct 23, 2001 at 12:09:01PM -0700
References:  <200110231909.f9NJ91q65339@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Robert Watson <rwatson@FreeBSD.org> [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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011023170218.Q15052>