@ahrens OK, thanks. Then how's this?

```
diff --git a/module/zfs/zfeature_common.c b/module/zfs/zfeature_common.c
index b11e647..fe20482 100644
--- a/module/zfs/zfeature_common.c
+++ b/module/zfs/zfeature_common.c
@@ -134,6 +134,19 @@ zfeature_depends_on(spa_feature_t fid, spa_feature_t 
check) {
        return (B_FALSE);
 }
 
+static boolean_t
+deps_contains_feature(const spa_feature_t *deps, const spa_feature_t feature)
+{
+       spa_feature_t *p = (spa_feature_t *)deps;
+
+       while (p && (*p != SPA_FEATURE_NONE)) {
+               if (*p == feature)
+                       return (B_TRUE);
+               p++;
+        }
+        return (B_FALSE);
+}
+
 static void
 zfeature_register(spa_feature_t fid, const char *guid, const char *name,
     const char *desc, zfeature_flags_t flags, const spa_feature_t *deps)
@@ -148,6 +161,9 @@ zfeature_register(spa_feature_t fid, const char *guid, 
const char *name,
        ASSERT3U(fid, <, SPA_FEATURES);
        ASSERT(zfeature_is_valid_guid(guid));
 
+       VERIFY(((flags & ZFEATURE_FLAG_PER_DATASET) == 0) ||
+           (deps_contains_feature(deps, SPA_FEATURE_EXTENSIBLE_DATASET)));
+
        if (deps == NULL)
                deps = nodeps;
 

```

---
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/51#issuecomment-179653063
_______________________________________________
developer mailing list
developer@open-zfs.org
http://lists.open-zfs.org/mailman/listinfo/developer

Reply via email to