From 18a8d3d7f828425762df3857e940dd1e6a5f2f86 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 4 Jul 2013 19:01:18 +0000 Subject: [PATCH] The tvp vnode on rename is usually unlinked. Drop the cached null vnode for tvp to allow the free of the lower vnode, if needed. PR: kern/180236 Tested by: smh Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/fs/nullfs/null_vnops.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 6ff15ee9f1d..70402e35f1d 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -554,6 +554,7 @@ null_rename(struct vop_rename_args *ap) struct vnode *fvp = ap->a_fvp; struct vnode *fdvp = ap->a_fdvp; struct vnode *tvp = ap->a_tvp; + struct null_node *tnn; /* Check for cross-device rename. */ if ((fvp->v_mount != tdvp->v_mount) || @@ -568,7 +569,11 @@ null_rename(struct vop_rename_args *ap) vrele(fvp); return (EXDEV); } - + + if (tvp != NULL) { + tnn = VTONULL(tvp); + tnn->null_flags |= NULLV_DROP; + } return (null_bypass((struct vop_generic_args *)ap)); }