HomeFreeBSD

Suppress static analyzer warning in dmu_objset_create_impl_dnstats()

Description

Suppress static analyzer warning in dmu_objset_create_impl_dnstats()

Clang's static analyzer claims that dereferencing ds in
dmu_objset_create_impl_dnstats() could cause a NULL pointer dereference
when a previous NULL check confirms that it is NULL. It is only NULL on
the MOS, for which dmu_objset_userused_enabled(os) should always return
false, so ds will never be dereferenced when it is NULL. We add an
assertion to suppress this warning.

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

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Feb 7 2023, 10:43 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Mar 1 2023, 1:31 AM
Parents
rG5cc49509013d: Suppress static analyzer warning in dbuf_hold_copy()
Branches
Unknown
Tags
Unknown