From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 06:35:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F0C51065672; Wed, 11 Apr 2012 06:35:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A0718FC1A; Wed, 11 Apr 2012 06:35:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3B6ZDWM058592; Wed, 11 Apr 2012 06:35:13 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3B6ZDg5058590; Wed, 11 Apr 2012 06:35:13 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201204110635.q3B6ZDg5058590@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 11 Apr 2012 06:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234122 - head/sbin/bsdlabel X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 06:35:14 -0000 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;