Date: Sun, 6 Oct 2013 06:14:30 +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: r256078 - stable/9/sys/kern Message-ID: <201310060614.r966EU5x032256@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Oct 6 06:14:29 2013 New Revision: 256078 URL: http://svnweb.freebsd.org/changeset/base/256078 Log: MFC r255942: For vunref(), try to upgrade the vnode lock if the function was called with the vnode shared-locked. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Sun Oct 6 06:09:43 2013 (r256077) +++ stable/9/sys/kern/vfs_subr.c Sun Oct 6 06:14:29 2013 (r256078) @@ -2343,8 +2343,10 @@ vputx(struct vnode *vp, int func) } break; case VPUTX_VUNREF: - if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) - error = EBUSY; + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + error = VOP_LOCK(vp, LK_TRYUPGRADE | LK_INTERLOCK); + VI_LOCK(vp); + } break; } if (vp->v_usecount > 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310060614.r966EU5x032256>