diff options
author | sos <sos@FreeBSD.org> | 2003-11-18 15:23:37 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2003-11-18 15:23:37 +0000 |
commit | b25c284c762863330646e18cdae2fa27c30085e3 (patch) | |
tree | b7e35c90ca62a01d9b33de309b3d0ff3ec37591e | |
parent | 832b97971fd86ac54a92ff83fe5d6cfead9bc01c (diff) | |
download | FreeBSD-src-b25c284c762863330646e18cdae2fa27c30085e3.zip FreeBSD-src-b25c284c762863330646e18cdae2fa27c30085e3.tar.gz |
Work around the problem that some CDROM drives might return different
TOC's for the same media!! that borks up GEOM.
Although this looks like bad HW the following patch removes the
chance for GEOM panic'ing.
Approved by: re@
-rw-r--r-- | sys/dev/ata/atapi-cd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 38369b9..50da005 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -1186,13 +1186,15 @@ acd_read_toc(struct acd_softc *cdp) int8_t ccb[16]; struct g_provider *pp; - bzero(&cdp->toc, sizeof(cdp->toc)); - bzero(ccb, sizeof(ccb)); + if (acd_test_ready(cdp->device)) + return; - if (acd_test_ready(cdp->device) != 0) + if (!(cdp->device->flags & ATA_D_MEDIA_CHANGED)) return; cdp->device->flags &= ~ATA_D_MEDIA_CHANGED; + bzero(&cdp->toc, sizeof(cdp->toc)); + bzero(ccb, sizeof(ccb)); cdp->disk_size = -1; /* hack for GEOM SOS */ len = sizeof(struct ioc_toc_header) + sizeof(struct cd_toc_entry); |