mirror_zfs/module
Richard Yao 88b199c24e
Cleanup spa_export_common()
Coverity complains about a possible NULL pointer dereference. This is
impossible, but it suspects it because we do a NULL check against
`spa->spa_root_vdev`. This NULL check was never necessary and makes the
code harder to understand, so we drop it.

In particular, we dereference `spa->spa_root_vdev` when `new_state !=
POOL_STATE_UNINITIALIZED && !hardforce`. The first is only true when
spa_reset is called, which only occurs under fault injection.  The
second is true unless `zpool export -F $POOLNAME` is used.  Therefore,
we effectively *always* dereference the pointer. In the cases where we
do not, there is no reason to think it is unsafe.  Therefore this change
is safe to make.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13905
2022-09-27 16:45:51 -07:00
..
avl Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
icp Fix bad free in skein code 2022-09-27 12:36:58 -07:00
lua LUA: Fix CVE-2014-5461 2022-09-27 16:44:13 -07:00
nvpair Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
os Cleanup: Specify unsignedness on things that should not be signed 2022-09-27 16:42:41 -07:00
unicode Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zcommon Enable relatime by default 2022-08-12 14:20:25 -07:00
zfs Cleanup spa_export_common() 2022-09-27 16:45:51 -07:00
zstd Cleanup: Specify unsignedness on things that should not be signed 2022-09-27 16:42:41 -07:00
.gitignore FreeBSD: Ignore symlink to i386 includes 2022-08-02 16:34:23 -07:00
Kbuild.in Cleanup dead spa_boot code 2022-09-13 16:40:10 -07:00
Makefile.bsd Cleanup dead spa_boot code 2022-09-13 16:40:10 -07:00
Makefile.in autoconf: use include directives instead of recursing down lib 2022-05-10 10:18:11 -07:00