Subject: Re: ccd errors? ccd0: error 5 on component 4
To: Marshall Midden <m4@nts.umn.edu>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: port-sparc
Date: 12/18/1996 11:07:21
On Wed, 18 Dec 1996 10:16:57 -0600
"Marshall Midden" <m4@nts.umn.edu> wrote:
> Guess what, disk label is in core! Doing a "df /dev/rsd${i}c" found the
> problem. Disk number 9 decided to die. So, the component "4" is not a very
> useful number.
Duh, I was playing a pointer trick that I shouldn't have been...
The patch below should fix the problem...
Jason R. Thorpe thorpej@nas.nasa.gov
NASA Ames Research Center Home: 408.866.1912
NAS: M/S 258-6 Work: 415.604.0935
Moffett Field, CA 94035 Pager: 415.428.6939
----- snip -----
Index: ccd.c
===================================================================
RCS file: /mastersrc/netbsd/src/sys/dev/ccd.c,v
retrieving revision 1.11
diff -c -r1.11 ccd.c
*** ccd.c 1996/10/16 02:45:11 1.11
--- ccd.c 1996/12/18 18:49:34
***************
*** 743,748 ****
--- 743,749 ----
register struct ccdcinfo *ci, *ci2 = NULL;
register struct ccdbuf *cbp;
register daddr_t cbn, cboff;
+ int ccdisk;
#ifdef DEBUG
if (ccddebug & CCDB_IO)
***************
*** 762,768 ****
register daddr_t sblk;
sblk = 0;
! for (ci = cs->sc_cinfo; cbn >= sblk + ci->ci_size; ci++)
sblk += ci->ci_size;
cbn -= sblk;
}
--- 763,771 ----
register daddr_t sblk;
sblk = 0;
! for (ccdisk = 0, ci = &cs->sc_cinfo[ccdisk];
! cbn >= sblk + ci->ci_size;
! ccdisk++, ci = &cs->sc_cinfo[ccdisk])
sblk += ci->ci_size;
cbn -= sblk;
}
***************
*** 771,777 ****
*/
else {
register struct ccdiinfo *ii;
! int ccdisk, off;
cboff = cbn % cs->sc_ileave;
cbn /= cs->sc_ileave;
--- 774,780 ----
*/
else {
register struct ccdiinfo *ii;
! int off;
cboff = cbn % cs->sc_ileave;
cbn /= cs->sc_ileave;
***************
*** 825,832 ****
* context for ccdiodone
*/
cbp->cb_obp = bp;
! cbp->cb_unit = cs - ccd_softc;
! cbp->cb_comp = ci - cs->sc_cinfo;
/* First buffer is dealt with. */
cbpp[0] = cbp;
--- 828,835 ----
* context for ccdiodone
*/
cbp->cb_obp = bp;
! cbp->cb_unit = cs->sc_unit;
! cbp->cb_comp = ccdisk;
/* First buffer is dealt with. */
cbpp[0] = cbp;