aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorilovezfs <[email protected]>2016-01-28 04:51:19 -0800
committerTony Hutter <[email protected]>2016-10-03 14:51:21 -0700
commit125a406e24fbfaec29557e88746210b9f18f646c (patch)
tree4007c3d17298909d0470c5c578def45d42f4cd53 /module
parent4a2e9a17d5b81ae97b2a1b72437def9ed4996aca (diff)
OpenZFS 6585 - sha512, skein, and edonr have an unenforced dependency on extensible dataset
Authored by: ilovezfs <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Richard Laager <[email protected]> Approved by: Robert Mustacchi <[email protected]> Ported by: Tony Hutter <[email protected]> In any pool without the extensible dataset feature flag already enabled, creating a dataset with dedup set to use one of the new checksums would result in the following panic as soon as any data was added: panic[cpu0]/thread=ffffff0006761c40: feature_get_refcount(spa, feature, &refcount) != 48 (0x30 != 0x30), file: ../../common/fs/zfs/zfeature.c line 390 Inpsection showed that feature->fi_feature was 7, which is the value of SPA_FEATURE_EXTENSIBLE_DATASET in the spa_feature enum. This commit adds extensible dataset as a dependency for the sha512, edonr, and skein feature flags, which prevents the panic. OpenZFS-issue: https://www.illumos.org/issues/6585 OpenZFS-commit: https://github.com/illumos/illumos-gate/commit/892586e8a147c02d7f4053cc405229a13e796928 Porting Notes: This code was originally from Illumos, but I actually ported it from: openzfsonosx/zfs@b62a652
Diffstat (limited to 'module')
-rw-r--r--module/zfs/zfeature_common.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/module/zfs/zfeature_common.c b/module/zfs/zfeature_common.c
index e8b0a16ae..9beb4903e 100644
--- a/module/zfs/zfeature_common.c
+++ b/module/zfs/zfeature_common.c
@@ -253,16 +253,36 @@ zpool_feature_init(void)
"Variable on-disk size of dnodes.",
ZFEATURE_FLAG_PER_DATASET, large_dnode_deps);
}
+
+ {
+ static const spa_feature_t sha512_deps[] = {
+ SPA_FEATURE_EXTENSIBLE_DATASET,
+ SPA_FEATURE_NONE
+ };
zfeature_register(SPA_FEATURE_SHA512,
"org.illumos:sha512", "sha512",
"SHA-512/256 hash algorithm.",
- ZFEATURE_FLAG_PER_DATASET, NULL);
+ ZFEATURE_FLAG_PER_DATASET, sha512_deps);
+ }
+ {
+ static const spa_feature_t skein_deps[] = {
+ SPA_FEATURE_EXTENSIBLE_DATASET,
+ SPA_FEATURE_NONE
+ };
zfeature_register(SPA_FEATURE_SKEIN,
"org.illumos:skein", "skein",
"Skein hash algorithm.",
- ZFEATURE_FLAG_PER_DATASET, NULL);
+ ZFEATURE_FLAG_PER_DATASET, skein_deps);
+ }
+
+ {
+ static const spa_feature_t edonr_deps[] = {
+ SPA_FEATURE_EXTENSIBLE_DATASET,
+ SPA_FEATURE_NONE
+ };
zfeature_register(SPA_FEATURE_EDONR,
"org.illumos:edonr", "edonr",
"Edon-R hash algorithm.",
- ZFEATURE_FLAG_PER_DATASET, NULL);
+ ZFEATURE_FLAG_PER_DATASET, edonr_deps);
+ }
}