From owner-svn-src-all@FreeBSD.ORG Mon Aug 13 13:33:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E656106564A; Mon, 13 Aug 2012 13:33:22 +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 EDF5B8FC12; Mon, 13 Aug 2012 13:33:21 +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 q7DDXLD7044878; Mon, 13 Aug 2012 13:33:21 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7DDXLWO044876; Mon, 13 Aug 2012 13:33:21 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201208131333.q7DDXLWO044876@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 13 Aug 2012 13:33:21 +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: r239232 - head/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2012 13:33:22 -0000 Author: ae Date: Mon Aug 13 13:33:21 2012 New Revision: 239232 URL: http://svn.freebsd.org/changeset/base/239232 Log: Restore the old behaviour. If requested partition is a BSD slice, but d_partition isn't explicitly set, then try to open BSD label and its first partition. Modified: head/sys/boot/common/disk.c Modified: head/sys/boot/common/disk.c ============================================================================== --- head/sys/boot/common/disk.c Mon Aug 13 13:10:50 2012 (r239231) +++ head/sys/boot/common/disk.c Mon Aug 13 13:33:21 2012 (r239232) @@ -185,10 +185,18 @@ disk_open(struct disk_devdesc *dev, off_ if (rc != 0) /* Partition doesn't exist */ goto out; dev->d_offset = part.start; - if (dev->d_partition == -1 || - dev->d_partition == 255) + if (dev->d_partition == 255) goto out; /* Nothing more to do */ - + if (dev->d_partition == -1) { + /* + * If we are looking at a BSD slice, and the + * partition is < 0, assume the 'a' partition. + */ + if (part.type == PART_FREEBSD) + dev->d_partition = 0; + else + goto out; + } /* Try to read BSD label */ table = ptable_open(dev, part.end - part.start + 1, od->sectorsize, ptblread);