]> git.proxmox.com Git - mirror_zfs.git/commit
Suppress static analyzer warning in dbuf_hold_copy()
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Tue, 7 Feb 2023 09:51:56 +0000 (04:51 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 1 Mar 2023 01:31:50 +0000 (17:31 -0800)
commit5cc49509013db4aa23f8e21eafdbde8403d5dffa
tree28634a7f99adb87bbc96058d2182f26e0b2e369b
parent9a14ce43c3d6a9939804215bbbe66de5115ace42
Suppress static analyzer warning in dbuf_hold_copy()

Clang's static analyzer claims that dbuf_hold_copy() will have a NULL
pointer dereference in data->b_data when called by dbuf_hold_impl().
This is impossible because data is dr->dt.dl.dr_data, which is non-NULL
whenever db->db_level == 0, which is always the case whenever
dbuf_hold_impl() calls dbuf_hold_copy(). We add an assertion to suppress
the complaint.

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
module/zfs/dbuf.c