From 3ec631295835c36dd5beb33a7aab666e2a004042 Mon Sep 17 00:00:00 2001 From: hannken Date: Wed, 10 Aug 2011 15:56:01 +0000 Subject: [PATCH] Update the (shared) v_interlock if the upper node changes. --- sys/fs/union/union_subr.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/fs/union/union_subr.c b/sys/fs/union/union_subr.c index a1cdf02eec2d..04ebd139811b 100644 --- a/sys/fs/union/union_subr.c +++ b/sys/fs/union/union_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: union_subr.c,v 1.45 2011/08/10 06:19:54 hannken Exp $ */ +/* $NetBSD: union_subr.c,v 1.46 2011/08/10 15:56:01 hannken Exp $ */ /* * Copyright (c) 1994 @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.45 2011/08/10 06:19:54 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.46 2011/08/10 15:56:01 hannken Exp $"); #include #include @@ -223,6 +223,12 @@ union_updatevp(struct union_node *un, struct vnode *uppervp, un->un_uppervp = uppervp; un->un_uppersz = VNOVAL; + /* Update union vnode interlock. */ + if (uppervp != NULL) { + mutex_obj_hold(uppervp->v_interlock); + uvm_obj_setlock(&UNIONTOV(un)->v_uobj, + uppervp->v_interlock); + } } if (docache && (ohash != nhash)) {