diff options
author | kib <kib@FreeBSD.org> | 2015-12-30 19:49:22 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-12-30 19:49:22 +0000 |
commit | f0089fdb6f3501da95454665558d11f5ee6c699c (patch) | |
tree | 856ddb9dc864c95c4a0cfd6d7ae20cf90e07d521 /sys/fs | |
parent | 145664c6751612bf7643f2b985f18e5c0695be8b (diff) | |
download | FreeBSD-src-f0089fdb6f3501da95454665558d11f5ee6c699c.zip FreeBSD-src-f0089fdb6f3501da95454665558d11f5ee6c699c.tar.gz |
Force nullfs vnode reclaim after unlinking, to potentially unlink
lower vnode. Otherwise, reference to the lower vnode from the upper
one prevents final unlink.
PR: 178238
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nullfs/null_vnops.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 4762a3c..72b884f 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -568,14 +568,16 @@ static int null_remove(struct vop_remove_args *ap) { int retval, vreleit; - struct vnode *lvp; + struct vnode *lvp, *vp; - if (vrefcnt(ap->a_vp) > 1) { - lvp = NULLVPTOLOWERVP(ap->a_vp); + vp = ap->a_vp; + if (vrefcnt(vp) > 1) { + lvp = NULLVPTOLOWERVP(vp); VREF(lvp); vreleit = 1; } else vreleit = 0; + VTONULL(vp)->null_flags |= NULLV_DROP; retval = null_bypass(&ap->a_gen); if (vreleit != 0) vrele(lvp); |