Make biowait() check bio_error before the BIO_ERROR flag, to propery

catch internal GEOM use of bio_error.

Sponsored by:	DARPA & NAI Labs.
This commit is contained in:
Poul-Henning Kamp 2002-09-26 16:32:14 +00:00
parent c2aee6b42d
commit 089cf428da

View File

@ -2845,10 +2845,10 @@ biowait(struct bio *bp, const char *wchan)
while ((bp->bio_flags & BIO_DONE) == 0)
msleep(bp, NULL, PRIBIO, wchan, hz / 10);
if (!(bp->bio_flags & BIO_ERROR))
return (0);
if (bp->bio_error != 0)
return (bp->bio_error);
if (!(bp->bio_flags & BIO_ERROR))
return (0);
return (EIO);
}