Page MenuHomeFreeBSD

loader: return errors from writing ZFS labels
ClosedPublic

Authored by imp on Feb 22 2024, 12:14 AM.
Tags
None
Referenced Files
F132265265: D44018.id134815.diff
Wed, Oct 15, 7:59 AM
Unknown Object (File)
Sat, Oct 11, 7:18 PM
Unknown Object (File)
Fri, Oct 10, 11:40 PM
Unknown Object (File)
Sun, Oct 5, 6:38 PM
Unknown Object (File)
Sat, Oct 4, 3:41 AM
Unknown Object (File)
Wed, Sep 17, 11:53 PM
Unknown Object (File)
Sep 15 2025, 1:43 PM
Unknown Object (File)
Sep 2 2025, 11:57 AM

Details

Summary

This can only return success. but we want to rerurn the last wrror.
this masked kboot's inability to write.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Feb 22 2024, 12:14 AM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 22 2024, 4:32 PM
This revision was automatically updated to reflect the committed changes.

Not sure if this is the right place to comment, but I saw this linked from https://code.illumos.org/c/illumos-gate/+/3328. There is indeed a bug in the original (a nonzero error code can be overwritten with zero) but it's been replaced with a different bug (a nonzero error code will never be returned..)

stand/libsa/zfs/zfsimpl.c
1691

I'm trying to figure out how this is supposed to work; we set rv to 0 above, and then only set it to rc if it is nonzero?

did you perhaps mean:

if (rc != 0) rv = rc;

(get return code of last failure)

or

if ((rc != 0) && (rv == 0)) rv = rc;

(get return code of first failure)?

stand/libsa/zfs/zfsimpl.c
1691

I read this backwards. rc and rv are terrible variables. The real fix is to change them all to something else. Or at least rc to something that doesn't look like rv.

I'd wanted 'if (rc != 0) rv = rc' to return the last error.

stand/libsa/zfs/zfsimpl.c
1691

https://reviews.freebsd.org/D44095
Do you want your email address in the reported by?

stand/libsa/zfs/zfsimpl.c
1691

https://reviews.freebsd.org/D44095
Do you want your email address in the reported by?

Yes, thank you. sommerfeld@hamachi.org