Module Name: src
Committed By: riz
Date: Sun Nov 21 21:52:04 UTC 2010
Modified Files:
src/sys/kern [netbsd-4]: subr_disk.c
Log Message:
Pull up following revision(s) (requested by mrg in ticket #1411):
sys/kern/subr_disk.c: revision 1.100
add some (uint64_t) casts so avoid 32 bit overflows. this fixes my
3TB disk with 4KB sectors and disklabel (which looks like it would
work upto 16TB.)
idea from mlel...@.
To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.83.2.1 src/sys/kern/subr_disk.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/subr_disk.c
diff -u src/sys/kern/subr_disk.c:1.83 src/sys/kern/subr_disk.c:1.83.2.1
--- src/sys/kern/subr_disk.c:1.83 Sat Nov 25 11:59:58 2006
+++ src/sys/kern/subr_disk.c Sun Nov 21 21:52:04 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_disk.c,v 1.83 2006/11/25 11:59:58 scw Exp $ */
+/* $NetBSD: subr_disk.c,v 1.83.2.1 2010/11/21 21:52:04 riz Exp $ */
/*-
* Copyright (c) 1996, 1997, 1999, 2000 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.83 2006/11/25 11:59:58 scw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.83.2.1 2010/11/21 21:52:04 riz Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -380,8 +380,8 @@
goto bad;
}
- p_size = p->p_size << dk->dk_blkshift;
- p_offset = p->p_offset << dk->dk_blkshift;
+ p_size = (uint64_t)p->p_size << dk->dk_blkshift;
+ p_offset = (uint64_t)p->p_offset << dk->dk_blkshift;
#if RAW_PART == 3
labelsector = lp->d_partitions[2].p_offset;
#else