From owner-svn-src-stable@freebsd.org Thu Jan 28 12:15:52 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33B40A70FFF; Thu, 28 Jan 2016 12:15:52 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0512A173D; Thu, 28 Jan 2016 12:15:51 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SCFper060342; Thu, 28 Jan 2016 12:15:51 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SCFpMt060341; Thu, 28 Jan 2016 12:15:51 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601281215.u0SCFpMt060341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 12:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r294982 - stable/10/sys/boot/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 12:15:52 -0000 Author: smh Date: Thu Jan 28 12:15:50 2016 New Revision: 294982 URL: https://svnweb.freebsd.org/changeset/base/294982 Log: MFC r294059: Ensure boot fsread correctly probes all partitions Sponsored by: Multiplay Modified: stable/10/sys/boot/common/ufsread.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/ufsread.c ============================================================================== --- stable/10/sys/boot/common/ufsread.c Thu Jan 28 12:11:42 2016 (r294981) +++ stable/10/sys/boot/common/ufsread.c Thu Jan 28 12:15:50 2016 (r294982) @@ -187,8 +187,15 @@ fsread(ufs_ino_t inode, void *buf, size_ blkbuf = dmadat->blkbuf; indbuf = dmadat->indbuf; - if (!dsk_meta) { + + /* + * Force probe if inode is zero to ensure we have a valid fs, otherwise + * when probing multiple paritions, reads from subsequent parititions + * will incorrectly succeed. + */ + if (!dsk_meta || inode == 0) { inomap = 0; + dsk_meta = 0; for (n = 0; sblock_try[n] != -1; n++) { if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, SBLOCKSIZE / DEV_BSIZE))