kernel - Remove improper EBUSY error on mount (2)
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 28 Feb 2013 01:08:37 +0000 (17:08 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 28 Feb 2013 01:08:37 +0000 (17:08 -0800)
* Fix lock order reversal in checkdirs() exposed by the removal
  of the VMOUNT flag.

sys/kern/vfs_syscalls.c

index 46c1714..9e53ce2 100644 (file)
@@ -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);