Date: Thu, 28 Jan 2016 12:15:51 +0000 (UTC) From: Steven Hartland <smh@FreeBSD.org> 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 Message-ID: <201601281215.u0SCFpMt060341@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601281215.u0SCFpMt060341>