Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Apr 2021 08:38:08 GMT
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 3056bbfc2cb2 - stable/13 - loader: we should support pools without features
Message-ID:  <202104100838.13A8c8Nb015892@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by tsoome:

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

commit 3056bbfc2cb24ec80ebfd831bf5c2fb3d7596a2f
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2021-04-02 23:40:51 +0000
Commit:     Toomas Soome <tsoome@FreeBSD.org>
CommitDate: 2021-04-09 20:09:28 +0000

    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 d36341f7b8ddc2457a1e9e4a721d27d2e66cb39a)
---
 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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104100838.13A8c8Nb015892>