kernel - Rename desiredvnodes to maxvnodes, fix deadlock
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 16 Oct 2016 21:13:39 +0000 (14:13 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 16 Oct 2016 21:13:39 +0000 (14:13 -0700)
commit9629eb3587b2cd563eccbd1eab0984b652f5dad5
treece11fd2e16a04a4c00c1c2e682f6bd286ba09ff8
parentf16ef74977e51e1bfc7a625dd18b98b02158e0e5
kernel - Rename desiredvnodes to maxvnodes, fix deadlock

* Rename the kernel variable 'desiredvnodes' to 'maxvnodes' to match
  the sysctl name (which has always been 'maxvnodes'), and to make the
  code more readable.

* Probable fix to a rare mount/umount deadlock which can occur in two
  situations (1) When a large number of mounts and unmounts are running
  concurrently, and (2) During a umount -a, shutdown, or reboot.

* Considered minor, normal use cases will not reproduce this bug.  Only
  synth or poudriere can generate the mount/umount traffic necessary to
  reproduce this bug.

* Also fixes a minor kernel memory leak of the mount structure which can
  occur when a 'df' or filesystem sync races a umount.  Also minor.

Reported-by: marino (mount race)
22 files changed:
sys/gnu/vfs/ext2fs/ext2_ihash.c
sys/gnu/vfs/ext2fs/ext2_quota.c
sys/kern/vfs_cache.c
sys/kern/vfs_lock.c
sys/kern/vfs_mount.c
sys/kern/vfs_subr.c
sys/kern/vfs_syscalls.c
sys/sys/mount.h
sys/sys/vnode.h
sys/vfs/hammer/hammer_vfsops.c
sys/vfs/hammer2/hammer2_vfsops.c
sys/vfs/hpfs/hpfs_hash.c
sys/vfs/isofs/cd9660/cd9660_node.c
sys/vfs/msdosfs/msdosfs_denode.c
sys/vfs/nfs/nfs_node.c
sys/vfs/ntfs/ntfs_ihash.c
sys/vfs/smbfs/smbfs_vfsops.c
sys/vfs/ufs/ffs_softdep.c
sys/vfs/ufs/ufs_ihash.c
sys/vfs/ufs/ufs_quota.c
usr.bin/systat/systat.1
usr.bin/systat/vmstat.c