This can only return success. but we want to rerurn the last wrror.
this masked kboot's inability to write.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
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 |
stand/libsa/zfs/zfsimpl.c | ||
---|---|---|
1691 |
Yes, thank you. sommerfeld@hamachi.org |