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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to