summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2011-01-01 20:49:54 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2011-01-01 20:49:54 +0000
commit4f3846d9c263d92aae520067973a60a70af25a85 (patch)
tree64d3b8be9c34d8a472222e97512a650b02fb1d47
parentbee1f1cbea66f84214a797be47e1eee2bd2cf348 (diff)
Corretctly return 0xffffffff for the returned LBA if the disk is too large
for the READ CAPACITY command.
-rw-r--r--sys/arch/sparc64/dev/vdsk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/sparc64/dev/vdsk.c b/sys/arch/sparc64/dev/vdsk.c
index 08f6305c552..406e37c85d3 100644
--- a/sys/arch/sparc64/dev/vdsk.c
+++ b/sys/arch/sparc64/dev/vdsk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vdsk.c,v 1.26 2011/01/01 20:32:18 kettenis Exp $ */
+/* $OpenBSD: vdsk.c,v 1.27 2011/01/01 20:49:53 kettenis Exp $ */
/*
* Copyright (c) 2009, 2011 Mark Kettenis
*
@@ -1100,11 +1100,11 @@ vdsk_scsi_capacity(struct scsi_xfer *xs)
bzero(&rcd, sizeof(rcd));
- capacity = sc->sc_vdisk_size;
+ capacity = sc->sc_vdisk_size - 1;
if (capacity > 0xffffffff)
capacity = 0xffffffff;
- _lto4b(capacity - 1, rcd.addr);
+ _lto4b(capacity, rcd.addr);
_lto4b(sc->sc_vdisk_block_size, rcd.length);
bcopy(&rcd, xs->data, MIN(sizeof(rcd), xs->datalen));