Date: Sun, 13 Jan 2013 00:46:39 +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: r245352 - stable/9/sys/fs/nullfs Message-ID: <201301130046.r0D0kdEn033252@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Jan 13 00:46:39 2013 New Revision: 245352 URL: http://svnweb.freebsd.org/changeset/base/245352 Log: MFC r245262: When nullfs mount is forcibly unmounted and nullfs vnode is reclaimed, get back the leased write reference from the lower vnode. There is no other path which can correct v_writecount on the lowervp. Modified: stable/9/sys/fs/nullfs/null_vnops.c Directory Properties: 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 Sun Jan 13 00:32:07 2013 (r245351) +++ stable/9/sys/fs/nullfs/null_vnops.c Sun Jan 13 00:46:39 2013 (r245352) @@ -725,6 +725,14 @@ null_reclaim(struct vop_reclaim_args *ap vp->v_object = NULL; vp->v_vnlock = &vp->v_lock; VI_UNLOCK(vp); + + /* + * If we were opened for write, we leased one write reference + * to the lower vnode. If this is a reclamation due to the + * forced unmount, undo the reference now. + */ + if (vp->v_writecount > 0) + VOP_ADD_WRITECOUNT(lowervp, -1); vput(lowervp); free(xp, M_NULLFSNODE);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301130046.r0D0kdEn033252>