svn commit: r323769 - head/sys/kern
Konstantin Belousov
kib at FreeBSD.org
Tue Sep 19 16:49:47 UTC 2017
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
More information about the svn-src-head
mailing list