loader: zfs: handle holes at the tail end correctly
Picked up from FreeBSD, work by Kyle Evans:
This mirrors dmu_read_impl(), zeroing out the tail end of the buffer and clipping the read to what's contained by the block that exists. This fixes an issue that arose during the 13.1 release process; in 13.1-RC1 and later, setting up GELI+ZFS will result in a failure to boot. The culprit is this, which causes us to fail to load geom_eli.ko as there's a residual portion after the single datablk that should be zeroed out. Differential Revision: https://reviews.freebsd.org/D35019 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263407#c10
Note the relation to 5905 is just about the dnode_read function and dn_maxblkid...
Testing done: the fix is verified in FreeBSD where there is reproducible case. Build/install/boot in illumos.
Updated by Electric Monk 4 months ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
commit 77570342d4bf7e1e439bf1b8008312de7f031a0a Author: Kyle Evans <kevans@FreeBSD.org> Date: 2022-04-23T18:15:08.000Z 14653 loader: zfs: handle holes at the tail end correctly Reviewed by: Toomas Soome <email@example.com> Reviewed by: Jason King <firstname.lastname@example.org> Approved by: Gordon Ross <email@example.com>