Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 2017 16:49:45 +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: r323769 - head/sys/kern
Message-ID:  <201709191649.v8JGnjQB044822@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Sep 19 16:49:45 2017
New Revision: 323769
URL: https://svnweb.freebsd.org/changeset/base/323769

Log:
  Do not vrele() covered vnode under the mp mutex.
  
  If vrele() changes the hold count to zero, it needs to acquire the
  vnode lock.
  
  Sponsored by:	The FreeBSD Foundation
  Discussed with:	avg
  X-MFC with:	r323578

Modified:
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c	Tue Sep 19 16:46:37 2017	(r323768)
+++ head/sys/kern/vfs_mount.c	Tue Sep 19 16:49:45 2017	(r323769)
@@ -507,8 +507,6 @@ vfs_mount_destroy(struct mount *mp)
 	KASSERT(mp->mnt_ref == 0,
 	    ("%s: invalid refcount in the drain path @ %s:%d", __func__,
 	    __FILE__, __LINE__));
-	if (mp->mnt_vnodecovered != NULL)
-		vrele(mp->mnt_vnodecovered);
 	if (mp->mnt_writeopcount != 0)
 		panic("vfs_mount_destroy: nonzero writeopcount");
 	if (mp->mnt_secondary_writes != 0)
@@ -531,6 +529,8 @@ vfs_mount_destroy(struct mount *mp)
 	if (mp->mnt_lockref != 0)
 		panic("vfs_mount_destroy: nonzero lock refcount");
 	MNT_IUNLOCK(mp);
+	if (mp->mnt_vnodecovered != NULL)
+		vrele(mp->mnt_vnodecovered);
 #ifdef MAC
 	mac_mount_destroy(mp);
 #endif



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