diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 161d4fea7f5b..cf16728a94ed 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1387,14 +1387,13 @@ dounmount(struct mount *mp, int flags, struct thread *td) dounmount_cleanup(mp, coveredvp, 0); return (EBUSY); } - mp->mnt_kern_flag |= MNTK_UNMOUNT | MNTK_NOINSMNTQ; + mp->mnt_kern_flag |= MNTK_UNMOUNT; if (flags & MNT_NONBUSY) { MNT_IUNLOCK(mp); error = vfs_check_usecounts(mp); MNT_ILOCK(mp); if (error != 0) { - dounmount_cleanup(mp, coveredvp, MNTK_UNMOUNT | - MNTK_NOINSMNTQ); + dounmount_cleanup(mp, coveredvp, MNTK_UNMOUNT); return (error); } } @@ -1456,7 +1455,6 @@ dounmount(struct mount *mp, int flags, struct thread *td) */ if (error && error != ENXIO) { MNT_ILOCK(mp); - mp->mnt_kern_flag &= ~MNTK_NOINSMNTQ; if ((mp->mnt_flag & MNT_RDONLY) == 0) { MNT_IUNLOCK(mp); vfs_allocate_syncvnode(mp); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 288a1ff905fa..d2012ee5f1b8 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1698,7 +1698,7 @@ insmntque1(struct vnode *vp, struct mount *mp, */ MNT_ILOCK(mp); VI_LOCK(vp); - if (((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && + if (((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0 && ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0 || mp->mnt_nvnodelistsize == 0)) && (vp->v_vflag & VV_FORCEINSMQ) == 0) { @@ -3818,7 +3818,6 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_UNMOUNTF); MNT_KERN_FLAG(MNTK_ASYNC); MNT_KERN_FLAG(MNTK_SOFTDEP); - MNT_KERN_FLAG(MNTK_NOINSMNTQ); MNT_KERN_FLAG(MNTK_DRAINING); MNT_KERN_FLAG(MNTK_REFEXPIRE); MNT_KERN_FLAG(MNTK_EXTENDED_SHARED); diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 0bd6d9928074..2b7f988b7639 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -368,23 +368,20 @@ void __mnt_vnode_markerfree_active(struct vnode **mvp, struct mount *); /* * Internal filesystem control flags stored in mnt_kern_flag. * - * MNTK_UNMOUNT locks the mount entry so that name lookup cannot proceed - * past the mount point. This keeps the subtree stable during mounts - * and unmounts. + * MNTK_UNMOUNT locks the mount entry so that name lookup cannot + * proceed past the mount point. This keeps the subtree stable during + * mounts and unmounts. When non-forced unmount flushes all vnodes + * from the mp queue, the MNTK_UNMOUNT flag prevents insmntque() from + * queueing new vnodes. * * MNTK_UNMOUNTF permits filesystems to detect a forced unmount while * dounmount() is still waiting to lock the mountpoint. This allows * the filesystem to cancel operations that might otherwise deadlock * with the unmount attempt (used by NFS). - * - * MNTK_NOINSMNTQ is strict subset of MNTK_UNMOUNT. They are separated - * to allow for failed unmount attempt to restore the syncer vnode for - * the mount. */ #define MNTK_UNMOUNTF 0x00000001 /* forced unmount in progress */ #define MNTK_ASYNC 0x00000002 /* filtered async flag */ #define MNTK_SOFTDEP 0x00000004 /* async disabled by softdep */ -#define MNTK_NOINSMNTQ 0x00000008 /* insmntque is not allowed */ #define MNTK_DRAINING 0x00000010 /* lock draining is happening */ #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ #define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */ diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 7a233536b316..aa7939c07b50 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -2028,8 +2028,6 @@ retry_flush: if (oldmnt->mnt_kern_flag & MNTK_UNMOUNT) { retry = 0; MNT_ILOCK(oldmnt); - KASSERT((oldmnt->mnt_kern_flag & MNTK_NOINSMNTQ) != 0, - ("softdep_flushfiles: !MNTK_NOINSMNTQ")); morework = oldmnt->mnt_nvnodelistsize > 0; #ifdef QUOTA ump = VFSTOUFS(oldmnt);