HomeFreeBSD

Linux: Suppress clang static analyzer warning in zfs_remove()

Description

Linux: Suppress clang static analyzer warning in zfs_remove()

Clang's static analyzer points out that if we fail to find an extended
attribute directory, but somehow find it when calculating delete_now and
delete_now is true, we will have a NULL pointer dereference when we try
to unlink the extended attribute directory.

I am not sure if this is possible, but if it is, I do not see a sane way
of handling this other than rolling back the transaction and retrying.
For now, let us do an VERIFY_IMPLY(). If this trips, it will stop the
transaction from committing, which will prevent an attribute directory
leak.

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

Details

Event Timeline

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