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
This commit is contained in:
Konstantin Belousov 2017-09-19 16:49:45 +00:00
parent 5bf949377e
commit 9770475ce7

View File

@ -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