cvs commit: src/sys/kern vfs_subr.c
Jeff Roberson
jroberson at chesapeake.net
Sun Mar 13 07:12:57 PST 2005
On Sun, 13 Mar 2005, Jeff Roberson wrote:
> jeff 2005-03-13 11:54:28 UTC
>
> FreeBSD src repository
>
> Modified files:
> sys/kern vfs_subr.c
There is a minor problem with my vget() changes that could lead to a vnode
leak in a very rare scenario. Basically, I forgot to drop a ref if I fail
with ENOENT in one or two cases, but this only happens if you try to lock
a vnode while it's being recycled. I'll fix it tomorrow afternoon. Until
then, it's really nothing to worry about.
> Log:
> - Remove vx_lock, vx_unlock, vx_wait, etc.
> - Add a vn_start_write/vn_finished_write around vlrureclaim so we don't do
> writing ops without suspending. This could suspend the vlruproc which
> should not be a problem under normal circumstances.
> - Manually implement VMIGHTFREE in vlrureclaim as this was the only instance
> where it was used.
> - Acquire a lock before calling vgone() as it now requires it.
> - Move the acquisition of the vnode interlock from vtryrecycle() to
> getnewvnode() so that if it fails we don't drop and reacquire the
> vnode_free_list_mtx.
> - Check for a usecount or holdcount at the end of vtryrecycle() in case
> someone grabbed a ref while we were recycling. Abort the recycle, and
> on the final ref drop this vnode will be placed on the head of the free
> list.
> - Move the redundant VOP_INACTIVE protection code into the local
> vinactive() routine to avoid code bloat.
> - Keep the vnode lock held across calls to vgone() in several places.
> - vgonel() no longer uses XLOCK, instead callers must hold an exclusive
> vnode lock. The VI_DOOMED flag is set to allow other threads to detect
> a vnode which is no longer valid. This flag is set until the last
> reference is gone, and there are no chances for a new ref. vgonel()
> holds this lock across the entire function, which greatly simplifies
> logic.
> _ Only vfree() in one place in vgone() not three.
> - Adjust vget() to check the VI_DOOMED flag prior to waiting on the lock
> in the LK_NOWAIT case. In other cases, check after we have slept and
> acquired an exlusive lock. This will simulate the old vx_wait()
> behavior.
>
> Sponsored by: Isilon Systems, Inc.
>
> Revision Changes Path
> 1.590 +129 -225 src/sys/kern/vfs_subr.c
>
More information about the cvs-src
mailing list