Module Name: src
Committed By: riz
Date: Sun Nov 21 21:48:29 UTC 2010
Modified Files:
src/sys/kern [netbsd-5]: subr_disk.c
Log Message:
Pull up following revision(s) (requested by mrg in ticket #1463):
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.93.10.1 -r1.93.10.2 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.93.10.1 src/sys/kern/subr_disk.c:1.93.10.2
--- src/sys/kern/subr_disk.c:1.93.10.1 Sat Apr 4 17:49:21 2009
+++ src/sys/kern/subr_disk.c Sun Nov 21 21:48:28 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_disk.c,v 1.93.10.1 2009/04/04 17:49:21 snj Exp $ */
+/* $NetBSD: subr_disk.c,v 1.93.10.2 2010/11/21 21:48:28 riz Exp $ */
/*-
* Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.93.10.1 2009/04/04 17:49:21 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.93.10.2 2010/11/21 21:48:28 riz Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -348,8 +348,8 @@
return -1;
}
- 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