aboutsummaryrefslogtreecommitdiff
path: root/sbin/bsdlabel
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2012-04-11 06:35:13 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2012-04-11 06:35:13 +0000
commitb9f41b60f45409cdb597c4bd524da8c159955d14 (patch)
treef4bab6483f04c744b5af093ae6ec449e80122b46 /sbin/bsdlabel
parent7e0fa1405272ec20439949f13ff03195bf7bc471 (diff)
downloadsrc-b9f41b60f45409cdb597c4bd524da8c159955d14.tar.gz
src-b9f41b60f45409cdb597c4bd524da8c159955d14.zip
It seems that libdisk(3) incorrectly sets d_secperunit value.
Automatically fix it like GEOM_PART_BSD does. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=234122
Diffstat (limited to 'sbin/bsdlabel')
-rw-r--r--sbin/bsdlabel/bsdlabel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 24d852b22a21..ce5d375f3181 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -1194,7 +1194,8 @@ checklabel(struct disklabel *lp)
lp->d_interleave = vl->d_interleave;
if (lp->d_secpercyl == 0)
lp->d_secpercyl = vl->d_secpercyl;
- if (lp->d_secperunit == 0)
+ if (lp->d_secperunit == 0 ||
+ lp->d_secperunit > vl->d_secperunit)
lp->d_secperunit = vl->d_secperunit;
if (lp->d_bbsize == 0)
lp->d_bbsize = vl->d_bbsize;