Subject: Re: mfs busted?
To: None <itojun@itojun.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 01/26/2004 18:21:11
hi,

> > > 	i've updated the kernel from 1.6ZH to 1.6ZI, and experienced a kernel
> > > 	panic on mount_mfs (from /etc/fstab).  i'm still using 1.6ZH
> > > 	newfs/mount_mfs (i'm in process of updating).  are there any important
> > > 	incompatible changes made to newfs/mount_mfs?  if so, it has to be
> > > 	documented in doc/UPDATING.
> > 
> > I *think* the problem is an (accidentally?) removed:
> > 
> >  bp->b_dev = vp->v_rdev;
> > 
> > that should still exist before:
> > 
> >  return (VOP_STRATEGY(vp, bp));
> > 
> > in ufs_strategy() in src/sys/ufs/ufs/ufs_vnops.c .  If you add that 
> > "bp->b_dev = ..." line back in, it should make things work again...
> 
> 	the change solved the problem, thanks.
> 
> itojun

i think mfs_strategy() should be fixed instead.

YAMAMOTO Takashi

Index: mfs_vnops.c
===================================================================
--- mfs_vnops.c	(revision 484)
+++ mfs_vnops.c	(working copy)
@@ -138,14 +138,15 @@ mfs_strategy(v)
 	void *v;
 {
 	struct vop_strategy_args /* {
+		struct vnode *a_vp;
 		struct buf *a_bp;
 	} */ *ap = v;
+	struct vnode *vp = ap->a_vp;
 	struct buf *bp = ap->a_bp;
 	struct mfsnode *mfsp;
-	struct vnode *vp;
 	struct proc *p = curproc;		/* XXX */
 
-	if (!vfinddev(bp->b_dev, VBLK, &vp) || vp->v_usecount == 0)
+	if (vp->v_type != VBLK || vp->v_usecount == 0)
 		panic("mfs_strategy: bad dev");
 	mfsp = VTOMFS(vp);
 	/* check for mini-root access */