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)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "[email protected]"

Reply via email to