Date: Sat, 18 Oct 1997 13:47:40 +0200 From: j@uriah.heep.sax.de (J Wunsch) To: hackers@FreeBSD.ORG Cc: tarkhil@mgt.msk.ru Subject: Re: Repeated panic during work with vn Message-ID: <19971018134740.JT61496@uriah.heep.sax.de> In-Reply-To: <199710131343.RAA01226@asteroid.mgt.msk.ru>; from Alexander B. Povolotsky on Oct 13, 1997 17:43:22 %2B0400 References: <199710131343.RAA01226@asteroid.mgt.msk.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
As Alexander B. Povolotsky wrote: > I am trying to make release, and I've got 100% repeateble panic during > doFS.sh execution. Try Mr. KATO's workaround: cvs diff: Diffing /sys/dev/vn Index: /sys/dev/vn/vn.c =================================================================== RCS file: /home/cvs/src/sys/dev/vn/vn.c,v retrieving revision 1.50 diff -u -u -r1.50 vn.c --- vn.c 1997/09/27 13:38:12 1.50 +++ vn.c 1997/10/13 20:53:51 @@ -228,6 +228,7 @@ register struct vn_softc *vn = vn_softc[unit]; register daddr_t bn; int error; + int isvplocked; long sz; struct uio auio; struct iovec aiov; @@ -276,12 +277,18 @@ auio.uio_rw = UIO_WRITE; auio.uio_resid = bp->b_bcount; auio.uio_procp = curproc; - vn_lock(vn->sc_vp, LK_EXCLUSIVE | LK_RETRY, curproc); + if (!VOP_ISLOCKED(vn->sc_vp)) { + isvplocked = 1; + vn_lock(vn->sc_vp, LK_EXCLUSIVE | LK_RETRY, curproc); + } if( bp->b_flags & B_READ) error = VOP_READ(vn->sc_vp, &auio, 0, vn->sc_cred); else error = VOP_WRITE(vn->sc_vp, &auio, 0, vn->sc_cred); - VOP_UNLOCK(vn->sc_vp, 0, curproc); + if (isvplocked) { + VOP_UNLOCK(vn->sc_vp, 0, curproc); + isvplocked = 0; + } bp->b_resid = auio.uio_resid; if( error ) @@ -305,10 +312,17 @@ int off, s, nra; nra = 0; + if (!VOP_ISLOCKED(vn->sc_vp)) { + isvplocked = 1; + vn_lock(vn->sc_vp, LK_EXCLUSIVE | LK_RETRY, curproc); + } vn_lock(vn->sc_vp, LK_EXCLUSIVE | LK_RETRY, curproc); error = VOP_BMAP(vn->sc_vp, (daddr_t)(byten / bsize), &vp, &nbn, &nra, NULL); - VOP_UNLOCK(vn->sc_vp, 0, curproc); + if (isvplocked) { + VOP_UNLOCK(vn->sc_vp, 0, curproc); + isvplocked = 0; + } if (error == 0 && nbn == -1) error = EIO; -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971018134740.JT61496>