Skip to content

Commit

Permalink
import: ignore return on hostid lookups
Browse files Browse the repository at this point in the history
Just silencing a warning. Its totally fine for a hostid to not be there.

Reported-by: Coverity (CID-1573336)

Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ameer Hamza <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes openzfs#15650
  • Loading branch information
robn authored Dec 7, 2023
1 parent f0cb648 commit 450f2d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 450f2d0

Please sign in to comment.