From e15f6c4df9ae59842d6ea1ef040974fdea821125 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 27 Feb 2013 17:08:37 -0800 Subject: [PATCH] kernel - Remove improper EBUSY error on mount (2) * Fix lock order reversal in checkdirs() exposed by the removal of the VMOUNT flag. --- sys/kern/vfs_syscalls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 46c17147e3..9e53ce26ec 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -480,7 +480,9 @@ checkdirs(struct nchandle *old_nch, struct nchandle *new_nch) mp = new_nch->mount; if (VFS_ROOT(mp, &newdp)) panic("mount: lost mount"); + vn_unlock(newdp); cache_lock(new_nch); + vn_lock(newdp, LK_EXCLUSIVE | LK_RETRY); cache_setunresolved(new_nch); cache_setvp(new_nch, newdp); cache_unlock(new_nch); -- 2.41.0