From ce34628b4b0387ae060e02684d6d178e75683f83 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Sat, 3 May 1997 21:19:54 +0000 Subject: [PATCH] Fix the umount problems for DEVFS. PR: 3276 & 3469 (the fixes), 2738, 2033 (reports) Submitted by: Dmitrij Tejblum --- sys/miscfs/devfs/devfs_tree.c | 8 +++++++- sys/miscfs/devfs/devfs_vfsops.c | 13 ++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c index 784f23b8957..c4b507ee304 100644 --- a/sys/miscfs/devfs/devfs_tree.c +++ b/sys/miscfs/devfs/devfs_tree.c @@ -2,7 +2,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.34 1997/02/12 16:19:04 mpp Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.35 1997/04/10 14:35:18 bde Exp $ */ #include "opt_devfs.h" @@ -496,6 +496,12 @@ devfs_dn_free(dn_p dnp) if(--dnp->links <= 0 ) /* can be -1 for initial free, on error */ { /*probably need to do other cleanups XXX */ + if (dnp->nextsibling != dnp) { + dn_p* prevp = dnp->prevsiblingp; + *prevp = dnp->nextsibling; + dnp->nextsibling->prevsiblingp = prevp; + + } if(dnp->type == DEV_SLNK) { free(dnp->by.Slnk.name,M_DEVFSNODE); } diff --git a/sys/miscfs/devfs/devfs_vfsops.c b/sys/miscfs/devfs/devfs_vfsops.c index a05a5fe4239..8e0114d0e27 100644 --- a/sys/miscfs/devfs/devfs_vfsops.c +++ b/sys/miscfs/devfs/devfs_vfsops.c @@ -1,7 +1,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vfsops.c,v 1.15 1996/11/21 07:18:58 julian Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vfsops.c,v 1.16 1997/02/12 16:19:08 mpp Exp $ * * */ @@ -139,13 +139,20 @@ DBPRINT(("start ")); /* * Unmount the filesystem described by mp. - * Note: vnodes from this FS may hang around if being used.. - * This should not be a problem, they should be self contained. */ static int devfs_unmount( struct mount *mp, int mntflags, struct proc *p) { struct devfsmount *devfs_mp_p = (struct devfsmount *)mp->mnt_data; + int flags = 0; + int error; + + if (mntflags & MNT_FORCE) { + flags |= FORCECLOSE; + } + error = vflush(mp, NULLVP, flags); + if (error) + return error; DBPRINT(("unmount ")); devfs_free_plane(devfs_mp_p);