Fix the file leak bug. The lower layer wasn't informed the vnode was inactive

and kept a reference, preventing the blocks to be reclaimed.

Changed the comment in null_inactive to reflect the current situation.

Reviewed by:	phk
This commit is contained in:
Ollivier Robert 1997-10-21 21:01:34 +00:00
parent fd5f040f7a
commit 1fb2a62daa
2 changed files with 16 additions and 4 deletions

View File

@ -37,11 +37,11 @@
*
* Ancestors:
* @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
* $Id: null_vnops.c,v 1.23 1997/10/15 09:21:07 phk Exp $
* $Id: null_vnops.c,v 1.24 1997/10/15 10:04:31 phk Exp $
* ...and...
* @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
*
* $Id: null_vnops.c,v 1.23 1997/10/15 09:21:07 phk Exp $
* $Id: null_vnops.c,v 1.24 1997/10/15 10:04:31 phk Exp $
*/
/*
@ -533,11 +533,16 @@ null_inactive(ap)
struct proc *a_p;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
struct null_node *xp = VTONULL(vp);
struct vnode *lowervp = xp->null_lowervp;
/*
* Do nothing (and _don't_ bypass).
* Wait to vrele lowervp until reclaim,
* so that until then our null_node is in the
* cache and reusable.
* We still have to tell the lower layer the vnode
* is now inactive though.
*
* NEEDSWORK: Someday, consider inactive'ing
* the lowervp and then trying to reactivate it
@ -545,6 +550,7 @@ null_inactive(ap)
* like they do in the name lookup cache code.
* That's too much work for now.
*/
VOP_INACTIVE(lowervp, ap->a_p);
VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
return (0);
}

View File

@ -37,11 +37,11 @@
*
* Ancestors:
* @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
* $Id: null_vnops.c,v 1.23 1997/10/15 09:21:07 phk Exp $
* $Id: null_vnops.c,v 1.24 1997/10/15 10:04:31 phk Exp $
* ...and...
* @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
*
* $Id: null_vnops.c,v 1.23 1997/10/15 09:21:07 phk Exp $
* $Id: null_vnops.c,v 1.24 1997/10/15 10:04:31 phk Exp $
*/
/*
@ -533,11 +533,16 @@ null_inactive(ap)
struct proc *a_p;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
struct null_node *xp = VTONULL(vp);
struct vnode *lowervp = xp->null_lowervp;
/*
* Do nothing (and _don't_ bypass).
* Wait to vrele lowervp until reclaim,
* so that until then our null_node is in the
* cache and reusable.
* We still have to tell the lower layer the vnode
* is now inactive though.
*
* NEEDSWORK: Someday, consider inactive'ing
* the lowervp and then trying to reactivate it
@ -545,6 +550,7 @@ null_inactive(ap)
* like they do in the name lookup cache code.
* That's too much work for now.
*/
VOP_INACTIVE(lowervp, ap->a_p);
VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
return (0);
}