From e54bb0ad8058c0f84ceb08b49bb1d22af829a9e8 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 22 Feb 2024 08:17:56 -0700 Subject: [PATCH] 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 --- stand/libsa/zfs/zfsimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index ed9c3753dd19..fc9bedac7621 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -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; }