From 6734ce8e36b95fafe001d2956bb65942845607be Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 8 Jun 2007 05:34:29 +0000 Subject: all disklabels read from the kernel now always contain a total sector size which is the REAL DISK SIZE. always. if a driver fails to set this right, please fix it. agreed with otto and krw --- sys/arch/mvme88k/mvme88k/disksubr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/arch/mvme88k') diff --git a/sys/arch/mvme88k/mvme88k/disksubr.c b/sys/arch/mvme88k/mvme88k/disksubr.c index 9bd51b1dc56..37e746f253b 100644 --- a/sys/arch/mvme88k/mvme88k/disksubr.c +++ b/sys/arch/mvme88k/mvme88k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.43 2007/06/07 03:41:52 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.44 2007/06/08 05:34:28 deraadt Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. @@ -382,7 +382,8 @@ cputobsdlabel(struct disklabel *lp, struct cpu_disklabel *clp) lp->d_ntracks = clp->cfg_hds; lp->d_secpercyl = clp->secpercyl; - DL_SETDSIZE(lp, clp->secperunit); + if (DL_GETDSIZE(lp) == 0) + DL_SETDSIZE(lp, clp->secperunit); lp->d_sparespertrack = clp->sparespertrack; lp->d_sparespercyl = clp->sparespercyl; lp->d_acylinders = clp->acylinders; @@ -439,7 +440,8 @@ cputobsdlabel(struct disklabel *lp, struct cpu_disklabel *clp) lp->d_ntracks = clp->cfg_hds; lp->d_secpercyl = clp->secpercyl; - DL_SETDSIZE(lp, clp->secperunit); + if (DL_GETDSIZE(lp) == 0) + DL_SETDSIZE(lp, clp->secperunit); lp->d_sparespertrack = clp->sparespertrack; lp->d_sparespercyl = clp->sparespercyl; lp->d_acylinders = clp->acylinders; -- cgit v1.2.3