HomeFreeBSD

Suppress clang static analyzer warning in vdev_stat_update()

Description

Suppress clang static analyzer warning in vdev_stat_update()

63652e154643cfe596fe077c13de0e7be34dd863 added unnecessary branches in
vdev_stat_update() to suppress an ASAN false positive the breaks
ztest. This had the downside of causing false positive reports in both
Coverity and Clang's static analyzer. vd is never NULL, so we add a
preprocessor check to only apply the workaround when compiling with ASAN
support.

Reported-by: Coverity (CID-1524583)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14575

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Mar 6 2023, 6:29 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Mar 8 2023, 9:52 PM
Parents
rG37edc7ea9881: Refactor loop in dump_histogram()
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG950980b4c4f8: Suppress clang static analyzer warning in vdev_stat_update() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Mar 8 2023, 9:52 PM