diff options
author | smh <smh@FreeBSD.org> | 2016-01-28 12:15:50 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2016-01-28 12:15:50 +0000 |
commit | 8b5dc50539615fa69e9ab67431908e0e9072482d (patch) | |
tree | 7b468cccdbd9000322e2590a371f1000bb205d18 | |
parent | 634e73dbb861268bd122cc29b02b1a56df450dd6 (diff) | |
download | FreeBSD-src-8b5dc50539615fa69e9ab67431908e0e9072482d.zip FreeBSD-src-8b5dc50539615fa69e9ab67431908e0e9072482d.tar.gz |
MFC r294059:
Ensure boot fsread correctly probes all partitions
Sponsored by: Multiplay
-rw-r--r-- | sys/boot/common/ufsread.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/boot/common/ufsread.c b/sys/boot/common/ufsread.c index acff1e5..08ab697 100644 --- a/sys/boot/common/ufsread.c +++ b/sys/boot/common/ufsread.c @@ -187,8 +187,15 @@ fsread(ufs_ino_t inode, void *buf, size_t nbyte) 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)) |