diff --git a/sys/adosfs/advfsops.c b/sys/adosfs/advfsops.c index 5ecb53421034..738a14b83522 100644 --- a/sys/adosfs/advfsops.c +++ b/sys/adosfs/advfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: advfsops.c,v 1.38 1999/10/18 19:52:24 wrstuden Exp $ */ +/* $NetBSD: advfsops.c,v 1.39 1999/10/20 14:32:09 enami Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -300,7 +300,8 @@ adosfs_unmount(mp, mntflags, p) if ((error = vflush(mp, NULLVP, flags)) != 0) return (error); amp = VFSTOADOSFS(mp); - amp->devvp->v_specflags &= ~SI_MOUNTEDON; + if (amp->devvp->v_type != VBAD) + amp->devvp->v_specflags &= ~SI_MOUNTEDON; vn_lock(amp->devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_CLOSE(amp->devvp, FREAD, NOCRED, p); vput(amp->devvp); diff --git a/sys/filecorefs/filecore_vfsops.c b/sys/filecorefs/filecore_vfsops.c index 992b748e6084..4c6f16a61d5b 100644 --- a/sys/filecorefs/filecore_vfsops.c +++ b/sys/filecorefs/filecore_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: filecore_vfsops.c,v 1.8 1999/10/16 23:53:27 wrstuden Exp $ */ +/* $NetBSD: filecore_vfsops.c,v 1.9 1999/10/20 14:32:10 enami Exp $ */ /*- * Copyright (c) 1998 Andrew McMurry @@ -393,7 +393,8 @@ filecore_unmount(mp, mntflags, p) fcmp = VFSTOFILECORE(mp); - fcmp->fc_devvp->v_specflags &= ~SI_MOUNTEDON; + if (fcmp->fc_devvp->v_type != VBAD) + fcmp->fc_devvp->v_specflags &= ~SI_MOUNTEDON; vn_lock(fcmp->fc_devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_CLOSE(fcmp->fc_devvp, FREAD, NOCRED, p); vput(fcmp->fc_devvp); diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index 2973ecf61c37..15fdff58992d 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_vfsops.c,v 1.40 1999/10/16 23:53:27 wrstuden Exp $ */ +/* $NetBSD: cd9660_vfsops.c,v 1.41 1999/10/20 14:32:10 enami Exp $ */ /*- * Copyright (c) 1994 @@ -510,7 +510,8 @@ cd9660_unmount(mp, mntflags, p) iso_dunmap(isomp->im_dev); #endif - isomp->im_devvp->v_specflags &= ~SI_MOUNTEDON; + if (isomp->im_devvp->v_type != VBAD) + isomp->im_devvp->v_specflags &= ~SI_MOUNTEDON; vn_lock(isomp->im_devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p); vput(isomp->im_devvp); diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c index dfd363891c72..7e7a340f5433 100644 --- a/sys/msdosfs/msdosfs_vfsops.c +++ b/sys/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_vfsops.c,v 1.63 1999/10/16 23:53:28 wrstuden Exp $ */ +/* $NetBSD: msdosfs_vfsops.c,v 1.64 1999/10/20 14:32:10 enami Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -756,7 +756,8 @@ msdosfs_unmount(mp, mntflags, p) if ((error = vflush(mp, NULLVP, flags)) != 0) return (error); pmp = VFSTOMSDOSFS(mp); - pmp->pm_devvp->v_specflags &= ~SI_MOUNTEDON; + if (pmp->pm_devvp->v_type != VBAD) + pmp->pm_devvp->v_specflags &= ~SI_MOUNTEDON; #ifdef MSDOSFS_DEBUG { struct vnode *vp = pmp->pm_devvp; diff --git a/sys/ntfs/ntfs_vfsops.c b/sys/ntfs/ntfs_vfsops.c index 1a3bc99bed95..beab4b166b86 100644 --- a/sys/ntfs/ntfs_vfsops.c +++ b/sys/ntfs/ntfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ntfs_vfsops.c,v 1.19 1999/10/20 14:25:42 enami Exp $ */ +/* $NetBSD: ntfs_vfsops.c,v 1.20 1999/10/20 14:32:10 enami Exp $ */ /*- * Copyright (c) 1998, 1999 Semen Ustimenko @@ -670,7 +670,8 @@ ntfs_unmount( vnode_pager_uncache(ntmp->ntm_devvp); VOP_UNLOCK(ntmp->ntm_devvp); #else - ntmp->ntm_devvp->v_specflags &= ~SI_MOUNTEDON; + if (ntmp->ntm_devvp->v_type != VBAD) + ntmp->ntm_devvp->v_specflags &= ~SI_MOUNTEDON; #endif vinvalbuf(ntmp->ntm_devvp, V_SAVE, NOCRED, p, 0, 0); diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index b95be1266d0d..8ea549ce9893 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs_vfsops.c,v 1.28 1999/10/16 23:53:28 wrstuden Exp $ */ +/* $NetBSD: ext2fs_vfsops.c,v 1.29 1999/10/20 14:32:11 enami Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. @@ -649,7 +649,8 @@ ext2fs_unmount(mp, mntflags, p) fs->e2fs.e2fs_state = E2FS_ISCLEAN; (void) ext2fs_sbupdate(ump, MNT_WAIT); } - ump->um_devvp->v_specflags &= ~SI_MOUNTEDON; + if (ump->um_devvp->v_type != VBAD) + ump->um_devvp->v_specflags &= ~SI_MOUNTEDON; vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_CLOSE(ump->um_devvp, fs->e2fs_ronly ? FREAD : FREAD|FWRITE, NOCRED, p); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 0b0a8ffb2dc0..3892763880d2 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_vfsops.c,v 1.53 1999/10/16 23:53:29 wrstuden Exp $ */ +/* $NetBSD: ffs_vfsops.c,v 1.54 1999/10/20 14:32:11 enami Exp $ */ /* * Copyright (c) 1989, 1991, 1993, 1994 @@ -692,7 +692,8 @@ ffs_unmount(mp, mntflags, p) fs->fs_clean = FS_ISCLEAN; (void) ffs_sbupdate(ump, MNT_WAIT); } - ump->um_devvp->v_specflags &= ~SI_MOUNTEDON; + if (ump->um_devvp->v_type != VBAD) + ump->um_devvp->v_specflags &= ~SI_MOUNTEDON; vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE, NOCRED, p); diff --git a/sys/ufs/lfs/lfs_vfsops.c b/sys/ufs/lfs/lfs_vfsops.c index d0b54b870552..da25fac4df4e 100644 --- a/sys/ufs/lfs/lfs_vfsops.c +++ b/sys/ufs/lfs/lfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_vfsops.c,v 1.39 1999/10/18 19:52:25 wrstuden Exp $ */ +/* $NetBSD: lfs_vfsops.c,v 1.40 1999/10/20 14:32:11 enami Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -527,7 +527,8 @@ lfs_unmount(mp, mntflags, p) vgone(fs->lfs_ivnode); ronly = !fs->lfs_ronly; - ump->um_devvp->v_specflags &= ~SI_MOUNTEDON; + if (ump->um_devvp->v_type != VBAD) + ump->um_devvp->v_specflags &= ~SI_MOUNTEDON; vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p);