Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Aug 2017 09:51:22 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r322883 - head/sys/ufs/ffs
Message-ID:  <201708250951.v7P9pMjm095001@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708250951.v7P9pMjm095001>