Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Oct 1998 16:38:16 -0500 (EST)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        freebsd-current@FreeBSD.ORG
Subject:   Re: panic mounting MFS filesystems
Message-ID:  <13876.60202.257941.268374@grasshopper.cs.duke.edu>
In-Reply-To: <13876.55104.517860.916965@grasshopper.cs.duke.edu>
References:  <13876.55104.517860.916965@grasshopper.cs.duke.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]

Andrew Gallatin writes:
 > 
 > 
 > The appended kludge allows me to again use MFS, but I'd appreciate it 
 > if somebody who knows the code better could look into this..
 > 

Actually, the above mentioned kludge allows me to mount an mfs fs, but the
first call to ufs_bmap on an mfs file will cause another panic.  Here's 
a better kludge.

Drew

------------------------------------------------------------------------------
Andrew Gallatin, Sr Systems Programmer	http://www.cs.duke.edu/~gallatin
Duke University				Email: gallatin@cs.duke.edu
Department of Computer Science		Phone: (919) 660-6590



[-- Attachment #2 --]
Index: kern/vfs_subr.c
===================================================================
RCS file: /scratch/freebsd-cvs/src/sys/kern/vfs_subr.c,v
retrieving revision 1.169
diff -u -r1.169 vfs_subr.c
--- vfs_subr.c	1998/10/26 08:07:00	1.169
+++ vfs_subr.c	1998/10/26 21:09:46
@@ -2533,8 +2533,10 @@
 			 */
 			object = vnode_pager_alloc(vp, IDX_TO_OFF(INT_MAX), 0, 0);
 		}
-		object->ref_count--;
-		vp->v_usecount--;
+		if(object) {
+			object->ref_count--;
+			vp->v_usecount--;
+		}
 	} else {
 		if (object->flags & OBJ_DEAD) {
 			VOP_UNLOCK(vp, 0, p);
Index: miscfs/specfs/spec_vnops.c
===================================================================
RCS file: /scratch/freebsd-cvs/src/sys/miscfs/specfs/spec_vnops.c,v
retrieving revision 1.75
diff -u -r1.75 spec_vnops.c
--- spec_vnops.c	1998/10/26 08:53:13	1.75
+++ spec_vnops.c	1998/10/26 21:26:24
@@ -285,7 +285,8 @@
 			return (EINVAL);
 		bsize = BLKDEV_IOSIZE;
 		dev = vp->v_rdev;
-		if ((ioctl = bdevsw[major(dev)]->d_ioctl) != NULL &&
+		if (major(dev) < nblkdev &&
+		    (ioctl = bdevsw[major(dev)]->d_ioctl) != NULL &&
 		    (*ioctl)(dev, DIOCGPART, (caddr_t)&dpart, FREAD, p) == 0 &&
 		    dpart.part->p_fstype == FS_BSDFFS &&
 		    dpart.part->p_frag != 0 && dpart.part->p_fsize != 0)
Index: ufs/ufs/ufs_bmap.c
===================================================================
RCS file: /scratch/freebsd-cvs/src/sys/ufs/ufs/ufs_bmap.c,v
retrieving revision 1.23
diff -u -r1.23 ufs_bmap.c
--- ufs_bmap.c	1998/10/26 08:53:13	1.23
+++ ufs_bmap.c	1998/10/26 21:25:29
@@ -149,7 +149,8 @@
 		 */
 		devvp = ip->i_devvp;
 
-		if (devvp != NULL && devvp->v_type == VBLK) {
+		if (devvp != NULL && devvp->v_type == VBLK &&
+		    (major(devvp->v_rdev) < nblkdev)) {
 			if (bdevsw[major(devvp->v_rdev)]->d_maxio > MAXPHYS) {
 				maxrun = MAXPHYS;
 				vp->v_maxio = MAXPHYS;

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13876.60202.257941.268374>