Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/scsipi Clamp sectors per unit in the default disklab...
details: https://anonhg.NetBSD.org/src/rev/be57df848528
branches: trunk
changeset: 786134:be57df848528
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Tue Apr 16 21:01:09 2013 +0000
description:
Clamp sectors per unit in the default disklabel to the maximum value,
instead of allowing it to wrap, as is already done in wd(4).
diffstat:
sys/dev/scsipi/sd.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (30 lines):
diff -r 9cf1521b33fc -r be57df848528 sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c Tue Apr 16 19:34:57 2013 +0000
+++ b/sys/dev/scsipi/sd.c Tue Apr 16 21:01:09 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sd.c,v 1.298 2012/04/19 17:45:20 bouyer Exp $ */
+/* $NetBSD: sd.c,v 1.299 2013/04/16 21:01:09 jakllsch Exp $ */
/*-
* Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.298 2012/04/19 17:45:20 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.299 2013/04/16 21:01:09 jakllsch Exp $");
#include "opt_scsi.h"
@@ -1319,7 +1319,10 @@
*/
strncpy(lp->d_typename, sd->name, 16);
strncpy(lp->d_packname, "fictitious", 16);
- lp->d_secperunit = sd->params.disksize;
+ if (sd->params.disksize > UINT32_MAX)
+ lp->d_secperunit = UINT32_MAX;
+ else
+ lp->d_secperunit = sd->params.disksize;
lp->d_rpm = sd->params.rot_rate;
lp->d_interleave = 1;
lp->d_flags = sd->sc_periph->periph_flags & PERIPH_REMOVABLE ?
Home |
Main Index |
Thread Index |
Old Index