Date: Tue, 27 Oct 1998 16:16:06 +1100 From: Bruce Evans <bde@zeta.org.au> To: freebsd-current@FreeBSD.ORG, gallatin@cs.duke.edu Subject: Re: panic mounting MFS filesystems Message-ID: <199810270516.QAA08046@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>Line 312 of mfs_vfsops.c,v 1.51 is assigning a major number of 255 to the mfs
>devvp. This vp is then falling through the cracks in the check around
>line 2553 of vfs_subr.c,v 1.169 because nblkdev == 128.
It would fail completely if nblkdev == 256, and used to overflow the
minor number after only 256 mfs mounts. Now it doesn't overflow the
minor number until after 2^24 mfs mounts.
>vnode_pager_alloc() never gets called & object remains null. The
>access done by object->ref_count causes-- the panic.
>
>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..
>Index: vfs_subr.c
>===================================================================
>RCS file: /scratch/freebsd-cvs/src/sys/kern/vfs_subr.c,v
>retrieving revision 1.169
>diff -c -r1.169 vfs_subr.c
>*** vfs_subr.c 1998/10/26 08:07:00 1.169
>--- vfs_subr.c 1998/10/26 20:06:04
>***************
>*** 2524,2531 ****
> if ((error = VOP_GETATTR(vp, &vat, cred, p)) != 0)
> goto retn;
> object = vnode_pager_alloc(vp, vat.va_size, 0, 0);
>! } else if (major(vp->v_rdev) < nblkdev &&
>! bdevsw[major(vp->v_rdev)] != NULL) {
> /*
> * This simply allocates the biggest object possible
> * for a VBLK vnode. This should be fixed, but doesn't
>--- 2524,2532 ----
> if ((error = VOP_GETATTR(vp, &vat, cred, p)) != 0)
> goto retn;
> object = vnode_pager_alloc(vp, vat.va_size, 0, 0);
>! } else if ((vp->v_tag == VT_MFS)
>! || ( major(vp->v_rdev) < nblkdev
>! && bdevsw[major(vp->v_rdev)] != NULL)) {
> /*
> * This simply allocates the biggest object possible
> * for a VBLK vnode. This should be fixed, but doesn't
The VT_MFS check should probably be in the callers. There are only 2
callers for the VBLK case, both in ffs_vfsops.c, and these used to check
that major(vp->v_rdev) < nblkdev, so the buggy check here never succeeded.
Bruce
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810270516.QAA08046>
