HomeFreeBSD

Suppress Clang static analyzer complaint in zfs_replay_create()

Description

Suppress Clang static analyzer complaint in zfs_replay_create()

Clang's static analyzer incorrectly complains about an undefined value
here when lr->lr_common.lrc_txtype == TX_SYMLINK and txtype ==
TX_CREATE. This is impossible, because of this line:

txtype = (lr->lr_common.lrc_txtype & ~TX_CI((uint64_t)0x1 << 63));

Changing the code to compare against txtype suppresses the report.

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 #14472

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Feb 14 2023, 7:05 PM
GitHub <noreply@github.com>Committed on Feb 14 2023, 7:05 PM
Parents
rG3fc92adc409a: Linux: use filemap_range_has_page()
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGf04cb31e7c17: Suppress Clang static analyzer complaint in zfs_replay_create() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Feb 14 2023, 7:05 PM