loader: we should support pools without features

nvlist_check_features_for_read() does return error when there
are no features for read.

MFC after: 5 days
This commit is contained in:
Toomas Soome 2021-04-03 02:40:51 +03:00
parent 6d3f54fd09
commit d36341f7b8

View File

@ -191,8 +191,16 @@ nvlist_check_features_for_read(nvlist_t *nvl)
rc = nvlist_find(nvl, ZPOOL_CONFIG_FEATURES_FOR_READ, rc = nvlist_find(nvl, ZPOOL_CONFIG_FEATURES_FOR_READ,
DATA_TYPE_NVLIST, NULL, &features, NULL); DATA_TYPE_NVLIST, NULL, &features, NULL);
if (rc != 0) switch (rc) {
return (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; data = (nvs_data_t *)features->nv_data;
nvp = &data->nvl_pair; /* first pair in nvlist */ nvp = &data->nvl_pair; /* first pair in nvlist */