loader: return errors from writing ZFS labels

vdev_write_bootenv_impl can only return success. Instead, return the
last error.  This will make any write errors more visible. The old code
masked kboot's inability to write bootenv.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D44018
This commit is contained in:
Warner Losh 2024-02-22 08:17:56 -07:00
parent b3e76e3d9e
commit e54bb0ad80

View File

@ -1688,7 +1688,7 @@ vdev_write_bootenv_impl(vdev_t *vdev, vdev_boot_envblock_t *be)
if (kid->v_state != VDEV_STATE_HEALTHY)
continue;
rc = vdev_write_bootenv_impl(kid, be);
if (rv == 0)
if (rv != 0)
rv = rc;
}