svn commit: r322883 - head/sys/ufs/ffs

Konstantin Belousov kib at FreeBSD.org
Fri Aug 25 09:51:23 UTC 2017


Author: kib
Date: Fri Aug 25 09:51:22 2017
New Revision: 322883
URL: https://svnweb.freebsd.org/changeset/base/322883

Log:
  Protect v_rdev dereference with the vnode interlock instead of the
  vnode lock.
  
  Caller of softdep_count_dependencies() may own a buffer lock, which
  might conflict with the lock order.
  
  Reported and tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	10 days

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c	Fri Aug 25 08:24:29 2017	(r322882)
+++ head/sys/ufs/ffs/ffs_softdep.c	Fri Aug 25 09:51:22 2017	(r322883)
@@ -13937,9 +13937,9 @@ softdep_count_dependencies(bp, wantcount)
 	 */
 retry:
 	if (vp->v_type == VCHR) {
-		VOP_LOCK(vp, LK_RETRY | LK_EXCLUSIVE);
+		VI_LOCK(vp);
 		mp = vp->v_type == VCHR ? vp->v_rdev->si_mountpt : NULL;
-		VOP_UNLOCK(vp, 0);
+		VI_UNLOCK(vp);
 		if (mp == NULL)
 			goto retry;
 	} else if (vp->v_type == VREG) {


More information about the svn-src-all mailing list