diff options
Diffstat (limited to 'sys')
-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)) |