From owner-freebsd-current Tue Jun 4 19:40:36 2002 Delivered-To: freebsd-current@freebsd.org Received: from hotmail.com (oe41.pav0.hotmail.com [64.4.32.121]) by hub.freebsd.org (Postfix) with ESMTP id 17A0B37B401; Tue, 4 Jun 2002 19:40:24 -0700 (PDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 4 Jun 2002 19:40:24 -0700 X-Originating-IP: [210.74.136.33] From: "kai ouyang" To: "John Baldwin" , Subject: Please help: why bufwait() will cause the thread status change to SSLEEP? Date: Wed, 5 Jun 2002 10:40:17 +0800 MIME-Version: 1.0 X-Mailer: MSN Explorer 7.00.0021.1900 Content-Type: multipart/mixed; boundary="----=_NextPart_001_0000_01C20C7D.61FF45C0" Message-ID: X-OriginalArrivalTime: 05 Jun 2002 02:40:24.0030 (UTC) FILETIME=[57CA2FE0:01C20C3A] Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ------=_NextPart_001_0000_01C20C7D.61FF45C0 Content-Type: multipart/alternative; boundary="----=_NextPart_002_0001_01C20C7D.61FF45C0" ------=_NextPart_002_0001_01C20C7D.61FF45C0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Dear John and everyone, I do not know the thread group means what in FreeBSD5.0. Could you give me some information? Now, I mask the code about thread group operations. When I want to get the RAIDFrame information(exist in the disk block). I can call raidread_component_label(), as the following: int raidread_component_label(dev, b_vp, clabel) udev_t dev; struct vnode *b_vp; RF_ComponentLabel_t *clabel; { =20 struct buf *bp; int error; =20 /* XXX should probably ensure that we don't try to do this if someone has changed rf_protected_sectors. */ =20 if (b_vp =3D=3D NULL) { /* For whatever reason, this component is not valid. Don't try to read a component label from it. */ return(EINVAL); } /* get a block of the appropriate size... */ bp =3D geteblk((int)RF_COMPONENT_INFO_SIZE); bp->b_dev =3D udev2dev(dev, 0); /* get our ducks in a row for the read */ bp->b_blkno =3D RF_COMPONENT_INFO_OFFSET / DEV_BSIZE; bp->b_bcount =3D RF_COMPONENT_INFO_SIZE; /*oyk add here to support FreeBSD5.0*/ bp->b_flags |=3D BIO_READ; bp->b_resid =3D RF_COMPONENT_INFO_SIZE / DEV_BSIZE; DEV_STRATEGY(bp, 0); error =3D bufwait(bp); bp->b_flags |=3D B_INVAL | B_AGE; bp->b_ioflags &=3D ~BIO_ERROR; if (!error) { memcpy(clabel, bp->b_data, sizeof(RF_ComponentLabel_t)); } brelse(bp); =20 return(error); } Now, when I excute the 'error =3D bufwait(bp);', the system will be crash= . the error information is also thread status SSLEEP. I do know what will cause the thread status change to SSLEEP. The function in FreeBSD4.x as following: int raidread_component_label(dev, b_vp, clabel) udev_t dev; struct vnode *b_vp; RF_ComponentLabel_t *clabel; { struct buf *bp; int error; =20 /* XXX should probably ensure that we don't try to do this if someone has changed rf_protected_sectors. */ =20 if (b_vp =3D=3D NULL) { /* For whatever reason, this component is not valid. Don't try to read a component label from it. */ return(EINVAL); } /* get a block of the appropriate size... */ bp =3D geteblk((int)RF_COMPONENT_INFO_SIZE); bp->b_dev =3D udev2dev(dev, 0); /* get our ducks in a row for the read */ bp->b_blkno =3D RF_COMPONENT_INFO_OFFSET / DEV_BSIZE; bp->b_bcount =3D RF_COMPONENT_INFO_SIZE; bp->b_flags |=3D B_READ; bp->b_resid =3D RF_COMPONENT_INFO_SIZE / DEV_BSIZE; BUF_STRATEGY(bp, 0); error =3D biowait(bp); =20 if (!error) { memcpy(clabel, bp->b_data, sizeof(RF_ComponentLabel_t)); } brelse(bp); =20 return(error); } I transfer it to FreeBSD5.0 according vinum example. Best Regards Ouyang Kai=B4=D3=CD=F8=D5=BE=B5=C3=B5=BD=B8=FC=B6=E0=D0=C5=CF=A2=A1=A3MSN= Explorer =C3=E2=B7=D1=CF=C2=D4=D8:http://explorer.msn.com/lccn ------=_NextPart_002_0001_01C20C7D.61FF45C0 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
Dear John and = everyone,
 
I do not know the thread group mea= ns what in FreeBSD5.0.
Could you give me some information?
Now, I m= ask the code about thread group operations.
When I want to get the RAI= DFrame information(exist in the disk block).
I can call raidread_compo= nent_label(), as the following:
int raidread_component_label(dev, b_vp= , clabel)
 udev_t dev;
 struct vnode *b_vp;
 RF_C= omponentLabel_t *clabel;
{
 
 struct buf *bp;
 = ;int error;
 
 /* XXX should probably ensure that we don'= t try to do this if
    someone has changed rf_protecte= d_sectors. */
 if (b_vp =3D=3D NULL) {
  /* For wha= tever reason, this component is not valid.
     Do= n't try to read a component label from it. */
  return(EINVA= L);
 }
 /* get a block of the appropriate size...= */
 bp =3D geteblk((int)RF_COMPONENT_INFO_SIZE);
 bp->= ;b_dev =3D udev2dev(dev, 0);
 /* get our ducks in a row f= or the read */
 bp->b_blkno =3D RF_COMPONENT_INFO_OFFSET / DEV= _BSIZE;
 bp->b_bcount =3D RF_COMPONENT_INFO_SIZE;
 /*o= yk add here to support FreeBSD5.0*/
 bp->b_flags |=3D BIO_READ= ;
  bp->b_resid =3D RF_COMPONENT_INFO_SIZE / DEV_BSIZE; DEV_STRATEGY(bp, 0);
 error =3D bufwait(bp);
 &nb= sp;      bp->b_flags |=3D B_INVAL | B_AGE;        bp->b_ioflags &=3D ~BI= O_ERROR;
       if (!error) {
 &= nbsp;memcpy(clabel, bp->b_data,
      = ;   sizeof(RF_ComponentLabel_t));
   =      }
 brelse(bp);
 return(error);<= BR>}
Now, when I excute the 'error =3D bufwait(bp);', the syst= em will be crash. the error information
is also thread status SSLEEP.<= BR>I do know what will cause the thread status change to SSLEEP.
The f= unction in FreeBSD4.x as following:
int raidread_component_label(dev, = b_vp, clabel)
 udev_t dev;
 struct vnode *b_vp;
 = RF_ComponentLabel_t *clabel;
{
 struct buf *bp;
 int e= rror;
 
 /* XXX should probably ensure that we don't try = to do this if
    someone has changed rf_protected_sect= ors. */
 if (b_vp =3D=3D NULL) {
  /* For w= hatever reason, this component is not valid.
     = Don't try to read a component label from it. */
  return(EIN= VAL);
 }
 /* get a block of the appropriate size.= .. */
 bp =3D geteblk((int)RF_COMPONENT_INFO_SIZE);
 bp-&= gt;b_dev =3D udev2dev(dev, 0);
 /* get our ducks in a row= for the read */
 bp->b_blkno =3D RF_COMPONENT_INFO_OFFSET / D= EV_BSIZE;
 bp->b_bcount =3D RF_COMPONENT_INFO_SIZE;
 b= p->b_flags |=3D B_READ;
  bp->b_resid =3D RF_COMPONENT= _INFO_SIZE / DEV_BSIZE;
 BUF_STRATEGY(bp, 0);
=  error =3D biowait(bp);
 if (!error) {
 &nb= sp;memcpy(clabel, bp->b_data,
      &= nbsp;  sizeof(RF_ComponentLabel_t));
    &nbs= p;   }
 brelse(bp);
 return(error);
}
&n= bsp;I transfer it to FreeBSD5.0 according vinum example.

Best Rega= rds
Ouyang Kai


=B4=D3=CD=F8=D5=BE= =B5=C3=B5=BD=B8=FC=B6=E0=D0=C5=CF=A2=A1=A3MSN Explorer =C3=E2=B7=D1=CF=C2= =D4=D8=A3=BAhttp://explorer.msn.= com/lccn

------=_NextPart_002_0001_01C20C7D.61FF45C0-- ------=_NextPart_001_0000_01C20C7D.61FF45C0 Content-Type: text/plain; name="bufwait.txt" Content-Disposition: attachment; filename="bufwait.txt" Content-Transfer-Encoding: quoted-printable I do not know the thread group means what in FreeBSD5.0. Could you give me some information? Now, I mask the code about thread group operations. When I want to get the RAIDFrame information(exist in the disk block). I can call raidread_component_label(), as the following: int raidread_component_label(dev, b_vp, clabel) udev_t dev; struct vnode *b_vp; RF_ComponentLabel_t *clabel; { =09 struct buf *bp; int error; =09 /* XXX should probably ensure that we don't try to do this if someone has changed rf_protected_sectors. */ =20 if (b_vp =3D=3D NULL) { /* For whatever reason, this component is not valid. Don't try to read a component label from it. */ return(EINVAL); } /* get a block of the appropriate size... */ bp =3D geteblk((int)RF_COMPONENT_INFO_SIZE); bp->b_dev =3D udev2dev(dev, 0); /* get our ducks in a row for the read */ bp->b_blkno =3D RF_COMPONENT_INFO_OFFSET / DEV_BSIZE; bp->b_bcount =3D RF_COMPONENT_INFO_SIZE; /*oyk add here to support FreeBSD5.0*/ bp->b_flags |=3D BIO_READ; bp->b_resid =3D RF_COMPONENT_INFO_SIZE / DEV_BSIZE; DEV_STRATEGY(bp, 0); error =3D bufwait(bp); bp->b_flags |=3D B_INVAL | B_AGE; bp->b_ioflags &=3D ~BIO_ERROR; if (!error) { memcpy(clabel, bp->b_data, sizeof(RF_ComponentLabel_t)); } brelse(bp); =20 return(error); } Now, when I excute the 'error =3D bufwait(bp);', the system will be crash= . the error information is also thread status SSLEEP. I do know what will cause the thread status change to SSLEEP. The function in FreeBSD4.x as following: int raidread_component_label(dev, b_vp, clabel) udev_t dev; struct vnode *b_vp; RF_ComponentLabel_t *clabel; { struct buf *bp; int error; =09 /* XXX should probably ensure that we don't try to do this if someone has changed rf_protected_sectors. */ =20 if (b_vp =3D=3D NULL) { /* For whatever reason, this component is not valid. Don't try to read a component label from it. */ return(EINVAL); } /* get a block of the appropriate size... */ bp =3D geteblk((int)RF_COMPONENT_INFO_SIZE); bp->b_dev =3D udev2dev(dev, 0); /* get our ducks in a row for the read */ bp->b_blkno =3D RF_COMPONENT_INFO_OFFSET / DEV_BSIZE; bp->b_bcount =3D RF_COMPONENT_INFO_SIZE; bp->b_flags |=3D B_READ; bp->b_resid =3D RF_COMPONENT_INFO_SIZE / DEV_BSIZE; BUF_STRATEGY(bp, 0); error =3D biowait(bp); =20 if (!error) { memcpy(clabel, bp->b_data, sizeof(RF_ComponentLabel_t)); } brelse(bp); =20 return(error); } I transfer it to FreeBSD5.0 according vinum example. ------=_NextPart_001_0000_01C20C7D.61FF45C0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message