import: ignore return on hostid lookups

Just silencing a warning. Its totally fine for a hostid to not be there.

Reported-by: Coverity (CID-1573336)

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #15650
This commit is contained in:
Rob N 2023-12-08 03:41:54 +11:00 committed by GitHub
parent f0cb6482e1
commit 450f2d0b08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3132,7 +3132,8 @@ zfs_force_import_required(nvlist_t *config)
* local hostid.
*/
if (nvlist_lookup_uint64(nvinfo, ZPOOL_CONFIG_HOSTID, &hostid) != 0)
nvlist_lookup_uint64(config, ZPOOL_CONFIG_HOSTID, &hostid);
(void) nvlist_lookup_uint64(config, ZPOOL_CONFIG_HOSTID,
&hostid);
if (state != POOL_STATE_EXPORTED && hostid != get_system_hostid())
return (B_TRUE);