diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-03-17 14:16:05 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-03-17 14:16:05 +0000 |
commit | c0b177fe05a7f10e70abcee079533145eb5dba77 (patch) | |
tree | 5024a4b2ec5e40cfa4d78ab902ed2c2a862cfb12 /sys/arch/vax | |
parent | e3f80c61b9b14ab0c39013d4206080bf56751949 (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/vax')
-rw-r--r-- | sys/arch/vax/vax/disksubr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c index 590c7c900cd..70b77a8e790 100644 --- a/sys/arch/vax/vax/disksubr.c +++ b/sys/arch/vax/vax/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.21 2003/11/10 21:05:06 miod Exp $ */ +/* $OpenBSD: disksubr.c,v 1.22 2004/03/17 14:16:04 miod Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1999/06/30 18:48:06 ragge Exp $ */ /* @@ -128,6 +128,8 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) int 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; |