summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorreinoud <reinoud@NetBSD.org>2006-08-31 19:46:54 +0000
committerreinoud <reinoud@NetBSD.org>2006-08-31 19:46:54 +0000
commit055cdf5d131564debd2c0aeb67a34821c253d8eb (patch)
treee6d921f9c24e81d4e78a732cbe2978697fe454ed /sys/dev
parent8cd106d3d2fa257141d908b543155aa4e5938692 (diff)
Fix fencing bug on CD disk size; the comment was wrong, its the *length* of
the device and since we count from zero its equal to the number of sectors and thus one higher than the last sector. This fixes the read/write problems on the (raw) device where the last sector was not readable/writable.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/scsipi/cd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/scsipi/cd.c b/sys/dev/scsipi/cd.c
index 6a7f39b1ece..5abcd62120a 100644
--- a/sys/dev/scsipi/cd.c
+++ b/sys/dev/scsipi/cd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cd.c,v 1.244 2006/08/28 00:22:15 christos Exp $ */
+/* $NetBSD: cd.c,v 1.245 2006/08/31 19:46:54 reinoud Exp $ */
/*-
* Copyright (c) 1998, 2001, 2003, 2004, 2005 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.244 2006/08/28 00:22:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.245 2006/08/31 19:46:54 reinoud Exp $");
#include "rnd.h"
@@ -1744,7 +1744,7 @@ cd_size(struct cd_softc *cd, int flags)
blksize = 2048;
}
cd->params.blksize = blksize;
- cd->params.disksize = size-1; /* disklabel is exclusive */
+ cd->params.disksize = size;
cd->params.disksize512 = ((u_int64_t)cd->params.disksize * blksize) / DEV_BSIZE;
SC_DEBUG(cd->sc_periph, SCSIPI_DB2,