diff options
| -rw-r--r-- | usr/src/boot/Makefile.version | 2 | ||||
| -rw-r--r-- | usr/src/boot/libsa/zfs/zfsimpl.c | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/usr/src/boot/Makefile.version b/usr/src/boot/Makefile.version index 6e0fa00d86..f0ea00a876 100644 --- a/usr/src/boot/Makefile.version +++ b/usr/src/boot/Makefile.version @@ -34,4 +34,4 @@ LOADER_VERSION = 1.1 # Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes. # The version is processed from left to right, the version number can only # be increased. -BOOT_VERSION = $(LOADER_VERSION)-2022.01.25.1 +BOOT_VERSION = $(LOADER_VERSION)-2022.04.21.1 diff --git a/usr/src/boot/libsa/zfs/zfsimpl.c b/usr/src/boot/libsa/zfs/zfsimpl.c index e83a8a3983..f2c5ca82d6 100644 --- a/usr/src/boot/libsa/zfs/zfsimpl.c +++ b/usr/src/boot/libsa/zfs/zfsimpl.c @@ -2348,6 +2348,19 @@ dnode_read(const spa_t *spa, const dnode_phys_t *dnode, off_t offset, } /* + * Handle odd block sizes, mirrors dmu_read_impl(). Data can't exist + * past the first block, so we'll clip the read to the portion of the + * buffer within bsize and zero out the remainder. + */ + if (dnode->dn_maxblkid == 0) { + size_t newbuflen; + + newbuflen = offset > bsize ? 0 : MIN(buflen, bsize - offset); + bzero((char *)buf + newbuflen, buflen - newbuflen); + buflen = newbuflen; + } + + /* * Note: bsize may not be a power of two here so we need to do an * actual divide rather than a bitshift. */ |
