A union node may be reactivated while it is being reclaimed so
change union_freevp() to detach the vnode from the union node by clearing the vnode backpointer and the lower node sizes.
This commit is contained in:
parent
2947811bbb
commit
645887d187
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: union_subr.c,v 1.70 2015/02/16 10:22:00 hannken Exp $ */
|
/* $NetBSD: union_subr.c,v 1.71 2015/02/24 16:08:01 hannken Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1994
|
* Copyright (c) 1994
|
||||||
@ -72,7 +72,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.70 2015/02/16 10:22:00 hannken Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.71 2015/02/24 16:08:01 hannken Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
@ -534,8 +534,14 @@ union_freevp(struct vnode *vp)
|
|||||||
{
|
{
|
||||||
struct union_node *un = VTOUNION(vp);
|
struct union_node *un = VTOUNION(vp);
|
||||||
|
|
||||||
|
/* Detach vnode from union node. */
|
||||||
|
un->un_vnode = NULL;
|
||||||
|
un->un_uppersz = VNOVAL;
|
||||||
|
un->un_lowersz = VNOVAL;
|
||||||
|
|
||||||
vcache_remove(vp->v_mount, &un, sizeof(un));
|
vcache_remove(vp->v_mount, &un, sizeof(un));
|
||||||
|
|
||||||
|
/* Detach union node from vnode. */
|
||||||
mutex_enter(vp->v_interlock);
|
mutex_enter(vp->v_interlock);
|
||||||
vp->v_data = NULL;
|
vp->v_data = NULL;
|
||||||
mutex_exit(vp->v_interlock);
|
mutex_exit(vp->v_interlock);
|
||||||
|
Loading…
Reference in New Issue
Block a user