Fix a bug were a struct bio was freed and certain members subsequently

examined.  Use biowait() instead of DIY.
This commit is contained in:
Poul-Henning Kamp 2002-09-13 11:37:38 +00:00
parent c7143e7150
commit 02aad38c79
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103282
2 changed files with 6 additions and 8 deletions

View File

@ -2561,6 +2561,7 @@ fdmisccmd(dev_t dev, u_int cmd, void *data)
struct fd_formb *finfo;
struct fdc_readid *idfield;
size_t fdblk;
int error;
fdu = FDUNIT(minor(dev));
fd = devclass_get_softc(fd_devclass, fdu);
@ -2602,11 +2603,9 @@ fdmisccmd(dev_t dev, u_int cmd, void *data)
* for the current context.
*/
fdstrategy(bp);
while ((bp->bio_flags & BIO_DONE) == 0)
tsleep(bp, PRIBIO, "fdcmd", 0);
error = biowait(bp, "fdcmd");
free(bp, M_TEMP);
return (bp->bio_flags & BIO_ERROR ? bp->bio_error : 0);
return (error);
}
static int

View File

@ -2561,6 +2561,7 @@ fdmisccmd(dev_t dev, u_int cmd, void *data)
struct fd_formb *finfo;
struct fdc_readid *idfield;
size_t fdblk;
int error;
fdu = FDUNIT(minor(dev));
fd = devclass_get_softc(fd_devclass, fdu);
@ -2602,11 +2603,9 @@ fdmisccmd(dev_t dev, u_int cmd, void *data)
* for the current context.
*/
fdstrategy(bp);
while ((bp->bio_flags & BIO_DONE) == 0)
tsleep(bp, PRIBIO, "fdcmd", 0);
error = biowait(bp, "fdcmd");
free(bp, M_TEMP);
return (bp->bio_flags & BIO_ERROR ? bp->bio_error : 0);
return (error);
}
static int