summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_cd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index 1e5be3c..d09d129 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -2773,8 +2773,12 @@ cdcheckmedia(struct cam_periph *periph)
softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC);
cdprevent(periph, PR_ALLOW);
return (error);
- } else
+ } else {
softc->flags |= CD_FLAG_VALID_MEDIA;
+ softc->disk->d_sectorsize = softc->params.blksize;
+ softc->disk->d_mediasize =
+ (off_t)softc->params.blksize * softc->params.disksize;
+ }
/*
* Now we check the table of contents. This (currently) is only
@@ -2863,9 +2867,6 @@ cdcheckmedia(struct cam_periph *periph)
}
softc->flags |= CD_FLAG_VALID_TOC;
- softc->disk->d_sectorsize = softc->params.blksize;
- softc->disk->d_mediasize =
- (off_t)softc->params.blksize * softc->params.disksize;
bailout:
OpenPOWER on IntegriCloud