diff options
author | kib <kib@FreeBSD.org> | 2013-07-04 19:01:18 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-07-04 19:01:18 +0000 |
commit | e9befff373a248b1bda99b8a03a3dfcefb519521 (patch) | |
tree | 4b0f81660bc845be609e6b1d369600646a2cfe8a /sys/fs/nullfs | |
parent | 3b474fdbb5698f190cfca02de07c90596d06fba2 (diff) | |
download | FreeBSD-src-e9befff373a248b1bda99b8a03a3dfcefb519521.zip FreeBSD-src-e9befff373a248b1bda99b8a03a3dfcefb519521.tar.gz |
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
Diffstat (limited to 'sys/fs/nullfs')
-rw-r--r-- | sys/fs/nullfs/null_vnops.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 6ff15ee..70402e3 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)); } |