Date: Wed, 14 Oct 1998 10:20:00 -0700 (PDT) From: Chris Timmons <skynyrd@opus.cts.cwu.edu> To: freebsd-bugs@FreeBSD.ORG Subject: Re: kern/8309 Message-ID: <199810141720.KAA12516@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/8309; it has been noted by GNATS. From: Chris Timmons <skynyrd@opus.cts.cwu.edu> To: freebsd-gnats-submit@freebsd.org Cc: Subject: Re: kern/8309 Date: Wed, 14 Oct 1998 10:17:08 -0700 (PDT) Added to the record with the permission of the author... ---------- Forwarded message ---------- Date: Wed, 14 Oct 1998 04:17:57 +0200 From: Tor.Egge@fast.no To: skynyrd@opus.cts.cwu.edu Cc: dt@FreeBSD.ORG, bde@FreeBSD.ORG, jhk@FreeBSD.ORG, dg@FreeBSD.ORG Subject: Re: kern/8309 > #9 0xf013742b in panic (fmt=0xf01ffbb9 "rslock: cpu: %d, addr: 0x%08x, > lock: 0x%08x") at ../../kern/kern_shutdown.c:428 > #10 0xf01ffbb9 in bsl1 () simple_lock (i.e. s_lock) is frameless. The caller is vinvalbuf. > #11 0xf01e1e2c in vm_object_terminate (object=0xf024b014) at > ../../vm/vm_object.c:444 vfs_subr.c has changed recently dt 1998/10/12 13:14:09 PDT Modified files: sys/kern vfs_subr.c Log: UnVMIO vnodes of block devices when they are no longer in use. (Some things, like msdosfs, do not work (panic) on devices with VMIO enabled. FFS enable VMIO on mounted devices, and nothing previously disabled it, so, after you mounted FFS floppy, you could not mount msdosfs floppy anymore...) This is mostly a quick before-release fix. Reviewed by: bde Revision Changes Path 1.164 +13 -2 src/sys/kern/vfs_subr.c That change is broken with regard to locking. vm_object_terminate might block. Thus, the vnode interlock should not be held. Instead, a full lock should be held. Moving the calls to vfs_object_destroy to right before the calls to VOP_INACTIVE looks like an easy fix, but that would introduce a potential vnode leak, since resident page count might be nonzero before vfs_object_destroy is called. By adding some code to vfs_object_destroy, this leak might be plugged. There is very little time left before 3.0 is released. I'll leave this task to the Release Engineer, expecting him to delegate this to somebody else on the CC list. Index: vfs_subr.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_subr.c,v retrieving revision 1.165 diff -u -r1.165 vfs_subr.c --- vfs_subr.c 1998/10/13 08:24:41 1.165 +++ vfs_subr.c 1998/10/14 01:15:57 @@ -1306,8 +1316,13 @@ struct vnode* vp; { if (vp->v_type == VBLK && vp->v_object != NULL && - vp->v_object->ref_count == 0) + vp->v_object->ref_count == 0) { vm_object_terminate(vp->v_object); + simple_lock(&vp->v_interlock); + if (VSHOULDFREE(vp)) + vfree(vp); + simple_unlock(&vp->v_interlock); + } } /* @@ -1336,7 +1351,6 @@ if (vp->v_usecount == 1) { - vfs_object_destroy(vp); vp->v_usecount--; if (VSHOULDFREE(vp)) vfree(vp); @@ -1346,6 +1360,7 @@ * vrele, we explicitly lock the vnode before calling VOP_INACTIVE. */ if (vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK, p) == 0) { + vfs_object_destroy(vp); VOP_INACTIVE(vp, p); } @@ -1381,7 +1396,6 @@ if (vp->v_usecount == 1) { - vfs_object_destroy(vp); vp->v_usecount--; if (VSHOULDFREE(vp)) vfree(vp); @@ -1391,6 +1405,7 @@ * vrele, we explicitly lock the vnode before calling VOP_INACTIVE. */ simple_unlock(&vp->v_interlock); + vfs_object_destroy(vp); VOP_INACTIVE(vp, p); } else { - Tor Egge To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810141720.KAA12516>