Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Apr 2012 06:35:13 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r234122 - head/sbin/bsdlabel
Message-ID:  <201204110635.q3B6ZDg5058590@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed Apr 11 06:35:13 2012
New Revision: 234122
URL: http://svn.freebsd.org/changeset/base/234122

Log:
  It seems that libdisk(3) incorrectly sets d_secperunit value.
  Automatically fix it like GEOM_PART_BSD does.
  
  MFC after:	1 week

Modified:
  head/sbin/bsdlabel/bsdlabel.c

Modified: head/sbin/bsdlabel/bsdlabel.c
==============================================================================
--- head/sbin/bsdlabel/bsdlabel.c	Wed Apr 11 06:34:25 2012	(r234121)
+++ head/sbin/bsdlabel/bsdlabel.c	Wed Apr 11 06:35:13 2012	(r234122)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204110635.q3B6ZDg5058590>