aboutsummaryrefslogtreecommitdiff
path: root/sys/cam
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-09-05 21:15:58 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-09-05 21:15:58 +0000
commit5ae652c0ed19b11e5080de5145302f7723a2b61a (patch)
tree147fda4145293281b55787fc3a7e6af561de17f6 /sys/cam
parentf46a6aac2950e4db7fce40dc666760142549510f (diff)
downloadsrc-5ae652c0ed19b11e5080de5145302f7723a2b61a.tar.gz
src-5ae652c0ed19b11e5080de5145302f7723a2b61a.zip
For removable devices without media we set a zero mediasize but a non-zero
sectorsize in order to avoid a lot of checks around various divisions etc. Enforce the sectorsize being > 0 with a KASSERT on successful open. Fix scsi_cd.c to return 2k sectors when no media inserted.
Notes
Notes: svn path=/head/; revision=134824
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_cd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index ac65e368ed63..f587b00a703c 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -2723,7 +2723,7 @@ cdcheckmedia(struct cam_periph *periph)
cdprevent(periph, PR_PREVENT);
softc->disk->d_maxsize = DFLTPHYS;
- softc->disk->d_sectorsize = 0;
+ softc->disk->d_sectorsize = 2048;
softc->disk->d_mediasize = 0;
/*