HomeFreeBSD

Linux: zfs_zaccess_trivial() should always call generic_permission()

Description

Linux: zfs_zaccess_trivial() should always call generic_permission()

Building with Clang on Linux generates a warning that err could be
uninitialized if mnt_ns is a NULL pointer. However, mnt_ns should never
be NULL, so there is no need to put this behind an if statement. Taking
it outside of the if statement means that the possibility of err being
uninitialized goes from being always zero in a way that the compiler
could not realize to a way that is always zero in a way that the
compiler can realize.

Sponsored-By: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Youzhong Yang <yyang@mathworks.com>
Signed-off-by: Richard Yao <richard.yao@klarasystems.com>
Closes #14738

Details

Provenance
Richard Yao <richard.yao@klarasystems.com>Authored on Apr 11 2023, 5:50 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Apr 20 2023, 5:29 PM
Parents
rGa10c64561648: ZTS: zvol_misc_trim retry busy export
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGab71b24d20df: Linux: zfs_zaccess_trivial() should always call generic_permission() (authored by Richard Yao <richard.yao@klarasystems.com>).Apr 20 2023, 5:29 PM