diff -u -r1.1.1.1 cd9660_vfsops.c --- isofs/cd9660/cd9660_vfsops.c 11 Apr 2003 00:34:55 -0000 1.1.1.1 +++ isofs/cd9660/cd9660_vfsops.c 20 Jan 2004 20:46:31 -0000 @@ -163,7 +163,7 @@ error = VOP_OPEN(rootvp, FREAD, FSCRED, p); VOP_UNLOCK(rootvp, 0, p); if (error) - return (error); + goto err; args.ssector = iso_get_ssector(rootdev, p); @@ -173,10 +173,15 @@ printf("iso_mountroot(): using session at block %d\n", args.ssector); if ((error = iso_mountfs(rootvp, mp, p, &args)) != 0) - return (error); + goto err; (void)cd9660_statfs(mp, &mp->mnt_stat, p); return (0); + + err: + /* Undo the addalias() called from bdevvp() */ + delalias(rootvp, rootdev); + return error; } /* Index: kern/vfs_subr.c =================================================================== diff -u -r1.1.1.1 vfs_subr.c --- kern/vfs_subr.c 11 Apr 2003 00:34:56 -0000 1.1.1.1 +++ kern/vfs_subr.c 20 Jan 2004 20:46:31 -0000 @@ -1481,6 +1481,22 @@ } /* + * Remove an alias created by addalias() + */ +void +delalias(nvp, dev) + struct vnode *nvp; + dev_t dev; +{ + if (nvp->v_type != VBLK && nvp->v_type != VCHR) + panic("delalias on non-special vnode"); + + simple_lock(&spechash_slock); + SLIST_REMOVE(&dev->si_hlist, nvp, vnode, v_specnext); + simple_unlock(&spechash_slock); +} + +/* * Grab a particular vnode from the free list, increment its * reference count and lock it. The vnode lock bit is set if the * vnode is being eliminated in vgone. The process is awakened