diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 92a6b31..e129633 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -345,7 +345,7 @@ vfs_busy(struct mount *mp, int flags) MNT_ILOCK(mp); MNT_REF(mp); - if (mp->mnt_kern_flag & MNTK_UNMOUNT) { + while (mp->mnt_kern_flag & MNTK_UNMOUNT) { if (flags & MBF_NOWAIT || mp->mnt_kern_flag & MNTK_REFEXPIRE) { MNT_REL(mp); MNT_IUNLOCK(mp); @@ -357,12 +357,8 @@ vfs_busy(struct mount *mp, int flags) mtx_unlock(&mountlist_mtx); mp->mnt_kern_flag |= MNTK_MWAIT; msleep(mp, MNT_MTX(mp), PVFS, "vfs_busy", 0); - MNT_REL(mp); - MNT_IUNLOCK(mp); if (flags & MBF_MNTLSTLOCK) mtx_lock(&mountlist_mtx); - CTR1(KTR_VFS, "%s: failed busying after sleep", __func__); - return (ENOENT); } if (flags & MBF_MNTLSTLOCK) mtx_unlock(&mountlist_mtx);