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
and
loader/zfs: Fix to actually return the last error
The last fix, to try to return the last error, really returns the first
return code after the last error, which could be zero. Instead, return
the last error. Also, change rc to err to make it visually distinct from
rv, which is the cause of my error in e54bb0ad8058.
Reported by: Bill Sommerfeld <sommerfeld@hamachi.org>
Fixes: e54bb0ad8058
Sponsored by: Netflix
(cherry picked from commit e54bb0ad8058c0f84ceb08b49bb1d22af829a9e8)
(cherry picked from commit 525e6d6c890f6aee898ac70347e5bb49da6638a1)