git: e54bb0ad8058 - main - loader: return errors from writing ZFS labels

From: Warner Losh <imp_at_FreeBSD.org>
Date: Thu, 22 Feb 2024 16:32:15 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=e54bb0ad8058c0f84ceb08b49bb1d22af829a9e8

commit e54bb0ad8058c0f84ceb08b49bb1d22af829a9e8
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-02-22 15:17:56 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-02-22 16:31:56 +0000

    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;
 	}