HomeFreeBSD

Add defensive assertions

Description

Add defensive assertions

Coverity complains about possible bugs involving referencing NULL return
values and division by zero. The division by zero bugs require that a
block pointer be corrupt, either from in-memory corruption, or on-disk
corruption. The NULL return value complaints are only bugs if
assumptions that we make about the state of data structures are wrong.
Some seem impossible to be wrong and thus are false positives, while
others are hard to analyze.

Rather than dismiss these as false positives by assuming we know better,
we add defensive assertions to let us know when our assumptions are
wrong.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13972

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Oct 12 2022, 6:25 PM
GitHub <noreply@github.com>Committed on Oct 12 2022, 6:25 PM
Parents
rGbfaa1d98f4ce: scripts/enum-extract.pl should not hard code perl path
Branches
Unknown
Tags
Unknown