summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-03-17 14:16:05 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-03-17 14:16:05 +0000
commitc0b177fe05a7f10e70abcee079533145eb5dba77 (patch)
tree5024a4b2ec5e40cfa4d78ab902ed2c2a862cfb12 /sys/arch/sparc
parente3f80c61b9b14ab0c39013d4206080bf56751949 (diff)
Make sure disklabels use at least DEV_BSIZE as their sector size.
This allows the kernel to survive reading the disklabel off a 256-bytes/sector scsi device... ok deraadt@
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r--sys/arch/sparc/sparc/disksubr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c
index 2878f8b6624..8bd369903df 100644
--- a/sys/arch/sparc/sparc/disksubr.c
+++ b/sys/arch/sparc/sparc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.29 2003/07/16 18:06:34 tedu Exp $ */
+/* $OpenBSD: disksubr.c,v 1.30 2004/03/17 14:16:04 miod Exp $ */
/* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */
/*
@@ -146,6 +146,8 @@ readdisklabel(dev, strat, lp, clp, spoofonly)
int error, i;
/* minimal requirements for archetypal disk label */
+ if (lp->d_secsize < DEV_BSIZE)
+ lp->d_secsize = DEV_BSIZE;
if (lp->d_secperunit == 0)
lp->d_secperunit = 0x1fffffff;
lp->d_npartitions = RAW_PART+1;