]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Linux: Suppress clang static analyzer warning in zfs_remove()
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Sun, 5 Mar 2023 06:32:03 +0000 (01:32 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 8 Mar 2023 21:52:04 +0000 (13:52 -0800)
commit66a38fd10ac5dd8734c9a024e8cb5745436e6f62
tree3c4dda6a2dfb911ac9a81fcaac6a2065d60e69ba
parentc2550a136ed578c20dc412ae427f3c9ca29e5e0c
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
module/os/linux/zfs/zfs_vnops_os.c