summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authordrochner <drochner@NetBSD.org>2000-01-25 20:42:33 +0000
committerdrochner <drochner@NetBSD.org>2000-01-25 20:42:33 +0000
commite81d123f6d7495e798e684e7d175da67acd7ca68 (patch)
treea733b5751126ac9af8a8b4532e1e2485088b0263 /sys/dev
parent6dc0e3435d20d3cabd6995e239510c5b43a9f4a2 (diff)
try to dtrt for sector sizes <DEV_BSIZE (at least, don't divide by 0)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/scsipi/sd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/scsipi/sd.c b/sys/dev/scsipi/sd.c
index ad4d78af701..00d638c7932 100644
--- a/sys/dev/scsipi/sd.c
+++ b/sys/dev/scsipi/sd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sd.c,v 1.155 2000/01/21 23:40:00 thorpej Exp $ */
+/* $NetBSD: sd.c,v 1.156 2000/01/25 20:42:33 drochner Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -694,7 +694,10 @@ sdstart(v)
* First, translate the block to absolute and put it in terms
* of the logical blocksize of the device.
*/
- blkno = bp->b_blkno / (lp->d_secsize / DEV_BSIZE);
+ if (lp->d_secsize >= DEV_BSIZE)
+ blkno = bp->b_blkno / (lp->d_secsize / DEV_BSIZE);
+ else
+ blkno = bp->b_blkno * (DEV_BSIZE / lp->d_secsize);
if (SDPART(bp->b_dev) != RAW_PART) {
p = &lp->d_partitions[SDPART(bp->b_dev)];
blkno += p->p_offset;