Date: Sun, 21 Jan 2007 02:10:21 GMT From: Tor Egge <Tor.Egge@cvsup.no.freebsd.org> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/108151: panic: relpbuf with vp Message-ID: <200701210210.l0L2ALfS044604@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/108151; it has been noted by GNATS. From: Tor Egge <Tor.Egge@cvsup.no.freebsd.org> To: netchild@freebsd.org Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: kern/108151: panic: relpbuf with vp Date: Sun, 21 Jan 2007 01:23:52 +0000 (UTC) ----Next_Part(Sun_Jan_21_01:23:52_2007_708)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit ffs_rawread_main() should call pbgetvp()/pbrelvp() instead of just setting b_vp directly. A suggested fix is enclosed. - Tor Egge ----Next_Part(Sun_Jan_21_01:23:52_2007_708)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rawread.diff" Index: sys/ufs/ffs/ffs_rawread.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_rawread.c,v retrieving revision 1.28 diff -u -r1.28 ffs_rawread.c --- sys/ufs/ffs/ffs_rawread.c 5 May 2006 21:27:31 -0000 1.28 +++ sys/ufs/ffs/ffs_rawread.c 21 Jan 2007 00:05:47 -0000 @@ -310,7 +310,7 @@ /* XXX: Leave some bufs for swap */ bp = getpbuf(&ffsrawbufcnt); sa = bp->b_data; - bp->b_vp = vp; + pbgetvp(vp, bp); error = ffs_rawread_readahead(vp, udata, offset, resid, td, bp, sa); if (error != 0) @@ -324,7 +324,7 @@ nbp = NULL; if (nbp != NULL) { nsa = nbp->b_data; - nbp->b_vp = vp; + pbgetvp(vp, nbp); nerror = ffs_rawread_readahead(vp, udata + @@ -337,6 +337,7 @@ nbp, nsa); if (nerror) { + pbrelvp(nbp); relpbuf(nbp, &ffsrawbufcnt); nbp = NULL; } @@ -385,6 +386,7 @@ nsa = tsa; if (resid <= bp->b_bufsize) { /* No more readaheads */ + pbrelvp(nbp); relpbuf(nbp, &ffsrawbufcnt); nbp = NULL; } else { /* Setup next readahead */ @@ -399,6 +401,7 @@ nbp, nsa); if (nerror != 0) { + pbrelvp(nbp); relpbuf(nbp, &ffsrawbufcnt); nbp = NULL; } @@ -413,13 +416,16 @@ } } - if (bp != NULL) + if (bp != NULL) { + pbrelvp(bp); relpbuf(bp, &ffsrawbufcnt); + } if (nbp != NULL) { /* Run down readahead buffer */ spl = splbio(); bwait(nbp, PRIBIO, "rawrd"); splx(spl); vunmapbuf(nbp); + pbrelvp(nbp); relpbuf(nbp, &ffsrawbufcnt); } ----Next_Part(Sun_Jan_21_01:23:52_2007_708)----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701210210.l0L2ALfS044604>