The branch main has been updated by tsoome:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d36341f7b8ddc2457a1e9e4a721d27d2e66cb39a

commit d36341f7b8ddc2457a1e9e4a721d27d2e66cb39a
Author:     Toomas Soome <[email protected]>
AuthorDate: 2021-04-02 23:40:51 +0000
Commit:     Toomas Soome <[email protected]>
CommitDate: 2021-04-03 23:01:03 +0000

    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
---
 stand/libsa/zfs/zfsimpl.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c
index bc577f168459..7036b508fa3c 100644
--- a/stand/libsa/zfs/zfsimpl.c
+++ b/stand/libsa/zfs/zfsimpl.c
@@ -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 */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "[email protected]"

Reply via email to