tmpfs: resolve deadlock between rename and unmount.
authorkib <kib@FreeBSD.org>
Sun, 24 Nov 2019 19:06:38 +0000 (19:06 +0000)
committerkib <kib@FreeBSD.org>
Sun, 24 Nov 2019 19:06:38 +0000 (19:06 +0000)
commitfc20114fc586a269de0b12674544f4eac5e7d97e
treea32f0bd70f96577fe4d783293bfb81b6d9ed03a2
parent372acbf63e1fb481a072eec71f60ea4a65377891
tmpfs: resolve deadlock between rename and unmount.

Top-level kern_renameat() increases the writecount on the mount point,
which, together with tmpfs unmount suspending the mount, already
ensures that unmount cannot proceed while rename unlocks and relocks
all operated vnodes.

Remove vfs_busy() call from tmpfs_rename() which was done while
holding a vnode lock, creating the deadlock.  The only intent of the
busy operation seems to be the prevention of unmount, which is already
ensured.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
sys/fs/tmpfs/tmpfs_vnops.c