Date: Tue, 6 Dec 2016 10:37:27 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r309609 - stable/9/sys/fs/nullfs Message-ID: <201612061037.uB6AbRGi016956@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Tue Dec 6 10:37:27 2016 New Revision: 309609 URL: https://svnweb.freebsd.org/changeset/base/309609 Log: MFC r292961, r295717: Force nullfs vnode reclaim after unlinking and directory removal. PR: 178238 Modified: stable/9/sys/fs/nullfs/null_vnops.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nullfs/null_vnops.c ============================================================================== --- stable/9/sys/fs/nullfs/null_vnops.c Tue Dec 6 10:24:33 2016 (r309608) +++ stable/9/sys/fs/nullfs/null_vnops.c Tue Dec 6 10:37:27 2016 (r309609) @@ -528,14 +528,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); @@ -577,6 +579,14 @@ null_rename(struct vop_rename_args *ap) return (null_bypass((struct vop_generic_args *)ap)); } +static int +null_rmdir(struct vop_rmdir_args *ap) +{ + + VTONULL(ap->a_vp)->null_flags |= NULLV_DROP; + return (null_bypass(&ap->a_gen)); +} + /* * We need to process our own vnode lock and then clear the * interlock flag as it applies only to our vnode, not the @@ -888,6 +898,7 @@ struct vop_vector null_vnodeops = { .vop_reclaim = null_reclaim, .vop_remove = null_remove, .vop_rename = null_rename, + .vop_rmdir = null_rmdir, .vop_setattr = null_setattr, .vop_strategy = VOP_EOPNOTSUPP, .vop_unlock = null_unlock,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612061037.uB6AbRGi016956>