mirror of
https://github.com/opnsense/src.git
synced 2026-05-16 11:09:35 -04:00
loader: we should support pools without features
nvlist_check_features_for_read() does return error when there
are no features for read.
Reported by: yuripv
(cherry picked from commit d36341f7b8)
This commit is contained in:
parent
e9fc871b0d
commit
3056bbfc2c
1 changed files with 10 additions and 2 deletions
|
|
@ -191,8 +191,16 @@ nvlist_check_features_for_read(nvlist_t *nvl)
|
|||
|
||||
rc = nvlist_find(nvl, ZPOOL_CONFIG_FEATURES_FOR_READ,
|
||||
DATA_TYPE_NVLIST, NULL, &features, NULL);
|
||||
if (rc != 0)
|
||||
return (rc);
|
||||
switch (rc) {
|
||||
case 0:
|
||||
break; /* Continue with checks */
|
||||
|
||||
case ENOENT:
|
||||
return (0); /* All features are disabled */
|
||||
|
||||
default:
|
||||
return (rc); /* Error while reading nvlist */
|
||||
}
|
||||
|
||||
data = (nvs_data_t *)features->nv_data;
|
||||
nvp = &data->nvl_pair; /* first pair in nvlist */
|
||||
|
|
|
|||
Loading…
Reference in a new issue